Class CollectingAfterFlushEntityListener

java.lang.Object
ch.tocco.nice2.persist.core.api.util.CollectingAfterFlushEntityListener
All Implemented Interfaces:
EntityFacadeListener, CommitListener, EventListener
Direct Known Subclasses:
ClearAddressFieldsEntityListener, DuplicateListener, DuplicatesMergeListener, DuplicatesSplitUpListener, EntityHistoryFieldEntityListener, EntityHistoryRelationEntityListener, GenericResourcePublishEntityListener

public abstract class CollectingAfterFlushEntityListener extends Object implements EntityFacadeListener, CommitListener
An EntityFacadeListener that collects all events during a transaction. The collected information is available from the CollectingAfterFlushEntityListener.EntityContext when onAfterFlush(Transaction) is called. onAfterFlush(Transaction) is triggered by CommitListener.afterFlush(Transaction) and must be implemented by subclasses and still runs inside the original transaction, but after the INSERT, DELETE and UPDATE statements have been executed. The priority() must be carefully evaluated to make sure that other CollectingAfterFlushEntityListener are not affected by this listener. createEntityContext() can be overridden to use a custom context if it is necessary to store additional data that would be no longer available after the session is flushed.
See Also: