Class DeleteSnippetWidgetSectionVisibilitiesListener

java.lang.Object
ch.tocco.nice2.persist.core.api.entity.events.InterruptibleEntityFacadeAdapter
ch.tocco.nice2.optional.cms.impl.entitylistener.DeleteSnippetWidgetSectionVisibilitiesListener
All Implemented Interfaces:
EntityFacadeListener, EventListener

public class DeleteSnippetWidgetSectionVisibilitiesListener extends InterruptibleEntityFacadeAdapter
When a Page_content_to_section is deleted (every time a section or snippet is deleted), all Section_visibility entities which are pointing to a widget which the deleted section contained should be deleted. If the Page_content_to_section entity pointed to a Section entity, this is done automatically by cascading delete: Page_content_to_section → Section → Widget → Section_visibility. If the Page_content_to_section entity pointed to a Snippet, the Snippet (and thus its Section and the Widget entities) won't be deleted. Therefore we need to delete the Section_visibility entities manually.