Class PersistentCollectionChangeWorkUnit
- java.lang.Object
-
- org.hibernate.envers.internal.synchronization.work.AbstractAuditWorkUnit
-
- org.hibernate.envers.internal.synchronization.work.PersistentCollectionChangeWorkUnit
-
- All Implemented Interfaces:
AuditWorkUnit,WorkUnitMergeDispatcher,WorkUnitMergeVisitor
public class PersistentCollectionChangeWorkUnit extends AbstractAuditWorkUnit implements AuditWorkUnit
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPersistentCollectionChangeWorkUnit.PersistentCollectionChangeWorkUnitIdA unique identifier for a collection work unit.
-
Field Summary
-
Fields inherited from class org.hibernate.envers.internal.synchronization.work.AbstractAuditWorkUnit
auditStrategy, entityName, enversService, id, revisionType, sessionImplementor
-
-
Constructor Summary
Constructors Constructor Description PersistentCollectionChangeWorkUnit(SessionImplementor sessionImplementor, String entityName, EnversService enversService, Object id, List<PersistentCollectionChangeData> collectionChanges, String referencingPropertyName)PersistentCollectionChangeWorkUnit(SessionImplementor sessionImplementor, String entityName, EnversService enversService, PersistentCollection collection, CollectionEntry collectionEntry, Serializable snapshot, Object id, String referencingPropertyName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsWork()AuditWorkUnitdispatch(WorkUnitMergeVisitor first)Should be invoked on the second work unit.Map<String,Object>generateData(Object revisionData)List<PersistentCollectionChangeData>getCollectionChanges()StringgetReferencingPropertyName()AuditWorkUnitmerge(AddWorkUnit second)AuditWorkUnitmerge(CollectionChangeWorkUnit second)AuditWorkUnitmerge(DelWorkUnit second)AuditWorkUnitmerge(FakeBidirectionalRelationWorkUnit second)AuditWorkUnitmerge(ModWorkUnit second)voidperform(Session session, Object revisionData)Perform this work unit in the given session.-
Methods inherited from class org.hibernate.envers.internal.synchronization.work.AbstractAuditWorkUnit
fillDataWithId, getEntityId, getEntityName, getRevisionType, isPerformed, setPerformed, undo
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.envers.internal.synchronization.work.AuditWorkUnit
getEntityId, getEntityName, getRevisionType, isPerformed, undo
-
-
-
-
Constructor Detail
-
PersistentCollectionChangeWorkUnit
public PersistentCollectionChangeWorkUnit(SessionImplementor sessionImplementor, String entityName, EnversService enversService, PersistentCollection collection, CollectionEntry collectionEntry, Serializable snapshot, Object id, String referencingPropertyName)
-
PersistentCollectionChangeWorkUnit
public PersistentCollectionChangeWorkUnit(SessionImplementor sessionImplementor, String entityName, EnversService enversService, Object id, List<PersistentCollectionChangeData> collectionChanges, String referencingPropertyName)
-
-
Method Detail
-
containsWork
public boolean containsWork()
- Specified by:
containsWorkin interfaceAuditWorkUnit
-
generateData
public Map<String,Object> generateData(Object revisionData)
- Specified by:
generateDatain interfaceAuditWorkUnit- Parameters:
revisionData- The current revision data, which will be used to populate the work unit with the correct revision relation.- Returns:
- Generates data that should be saved when performing this work unit.
-
perform
public void perform(Session session, Object revisionData)
Description copied from interface:AuditWorkUnitPerform this work unit in the given session.- Specified by:
performin interfaceAuditWorkUnit- Overrides:
performin classAbstractAuditWorkUnit- Parameters:
session- Session, in which the work unit should be performed.revisionData- The current revision data, which will be used to populate the work unit with the correct revision relation.
-
getReferencingPropertyName
public String getReferencingPropertyName()
-
getCollectionChanges
public List<PersistentCollectionChangeData> getCollectionChanges()
-
merge
public AuditWorkUnit merge(AddWorkUnit second)
- Specified by:
mergein interfaceWorkUnitMergeVisitor
-
merge
public AuditWorkUnit merge(ModWorkUnit second)
- Specified by:
mergein interfaceWorkUnitMergeVisitor
-
merge
public AuditWorkUnit merge(DelWorkUnit second)
- Specified by:
mergein interfaceWorkUnitMergeVisitor
-
merge
public AuditWorkUnit merge(CollectionChangeWorkUnit second)
- Specified by:
mergein interfaceWorkUnitMergeVisitor
-
merge
public AuditWorkUnit merge(FakeBidirectionalRelationWorkUnit second)
- Specified by:
mergein interfaceWorkUnitMergeVisitor
-
dispatch
public AuditWorkUnit dispatch(WorkUnitMergeVisitor first)
Description copied from interface:WorkUnitMergeDispatcherShould be invoked on the second work unit.- Specified by:
dispatchin interfaceWorkUnitMergeDispatcher- Parameters:
first- First work unit (that is, the one added earlier).- Returns:
- The work unit that is the result of the merge.
-
-