Package org.hibernate.envers.event.spi
Class BaseEnversCollectionEventListener
- java.lang.Object
-
- org.hibernate.envers.event.spi.BaseEnversEventListener
-
- org.hibernate.envers.event.spi.BaseEnversCollectionEventListener
-
- All Implemented Interfaces:
EnversListener
- Direct Known Subclasses:
EnversPostCollectionRecreateEventListenerImpl
,EnversPreCollectionRemoveEventListenerImpl
,EnversPreCollectionUpdateEventListenerImpl
public abstract class BaseEnversCollectionEventListener extends BaseEnversEventListener
Base class for Envers' collection event related listeners
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseEnversCollectionEventListener(EnversService enversService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CollectionEntry
getCollectionEntry(AbstractCollectionEvent event)
protected Serializable
initializeCollection(AbstractCollectionEvent event)
Forces persistent collection initialization.protected void
onCollectionAction(AbstractCollectionEvent event, PersistentCollection newColl, Serializable oldColl, CollectionEntry collectionEntry)
protected void
onCollectionActionInversed(AbstractCollectionEvent event, PersistentCollection newColl, Serializable oldColl, CollectionEntry collectionEntry)
protected boolean
shouldGenerateRevision(AbstractCollectionEvent event)
Checks whether modification of not-owned relation field triggers new revision and owner entity is versioned.-
Methods inherited from class org.hibernate.envers.event.spi.BaseEnversEventListener
checkIfTransactionInProgress, generateBidirectionalCollectionChangeWorkUnits, getEnversService
-
-
-
-
Constructor Detail
-
BaseEnversCollectionEventListener
protected BaseEnversCollectionEventListener(EnversService enversService)
-
-
Method Detail
-
getCollectionEntry
protected final CollectionEntry getCollectionEntry(AbstractCollectionEvent event)
-
onCollectionAction
protected final void onCollectionAction(AbstractCollectionEvent event, PersistentCollection newColl, Serializable oldColl, CollectionEntry collectionEntry)
-
onCollectionActionInversed
protected final void onCollectionActionInversed(AbstractCollectionEvent event, PersistentCollection newColl, Serializable oldColl, CollectionEntry collectionEntry)
-
initializeCollection
protected Serializable initializeCollection(AbstractCollectionEvent event)
Forces persistent collection initialization.- Parameters:
event
- Collection event.- Returns:
- Stored snapshot.
-
shouldGenerateRevision
protected boolean shouldGenerateRevision(AbstractCollectionEvent event)
Checks whether modification of not-owned relation field triggers new revision and owner entity is versioned.- Parameters:
event
- Collection event.- Returns:
true
if revision based on given event should be generated,false
otherwise.
-
-