org.hibernate.envers.event
Class BaseEnversCollectionEventListener

java.lang.Object
  extended by org.hibernate.envers.event.BaseEnversEventListener
      extended by org.hibernate.envers.event.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
protected BaseEnversCollectionEventListener(AuditConfiguration enversConfiguration)
           
 
Method Summary
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  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.BaseEnversEventListener
checkIfTransactionInProgress, generateBidirectionalCollectionChangeWorkUnits, getAuditConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseEnversCollectionEventListener

protected BaseEnversCollectionEventListener(AuditConfiguration enversConfiguration)
Method Detail

getCollectionEntry

protected final CollectionEntry getCollectionEntry(AbstractCollectionEvent event)

onCollectionAction

protected final void onCollectionAction(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.


Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.