Class FakeBidirectionalRelationWorkUnit
- java.lang.Object
-
- org.hibernate.envers.internal.synchronization.work.AbstractAuditWorkUnit
-
- org.hibernate.envers.internal.synchronization.work.FakeBidirectionalRelationWorkUnit
-
- All Implemented Interfaces:
AuditWorkUnit
,WorkUnitMergeDispatcher
,WorkUnitMergeVisitor
public class FakeBidirectionalRelationWorkUnit extends AbstractAuditWorkUnit implements AuditWorkUnit
A work unit that handles "fake" bidirectional one-to-many relations (mapped with@OneToMany+@JoinColumn
and@ManyToOne+@Column(insertable=false, updatable=false)
.
-
-
Field Summary
-
Fields inherited from class org.hibernate.envers.internal.synchronization.work.AbstractAuditWorkUnit
auditStrategy, entityName, enversService, id, revisionType, sessionImplementor
-
-
Constructor Summary
Constructors Constructor Description FakeBidirectionalRelationWorkUnit(SessionImplementor sessionImplementor, String entityName, EnversService enversService, Serializable id, String referencingPropertyName, Object owningEntity, RelationDescription rd, RevisionType revisionType, Object index, AuditWorkUnit nestedWorkUnit)
FakeBidirectionalRelationWorkUnit(FakeBidirectionalRelationWorkUnit original, Map<String,org.hibernate.envers.internal.synchronization.work.FakeBidirectionalRelationWorkUnit.FakeRelationChange> fakeRelationChanges, AuditWorkUnit nestedWorkUnit)
FakeBidirectionalRelationWorkUnit(FakeBidirectionalRelationWorkUnit original, AuditWorkUnit nestedWorkUnit)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsWork()
AuditWorkUnit
dispatch(WorkUnitMergeVisitor first)
Should be invoked on the second work unit.Map<String,Object>
generateData(Object revisionData)
Map<String,org.hibernate.envers.internal.synchronization.work.FakeBidirectionalRelationWorkUnit.FakeRelationChange>
getFakeRelationChanges()
AuditWorkUnit
getNestedWorkUnit()
AuditWorkUnit
merge(AddWorkUnit second)
AuditWorkUnit
merge(CollectionChangeWorkUnit second)
AuditWorkUnit
merge(DelWorkUnit second)
AuditWorkUnit
merge(FakeBidirectionalRelationWorkUnit second)
static AuditWorkUnit
merge(FakeBidirectionalRelationWorkUnit frwu, AuditWorkUnit nestedFirst, AuditWorkUnit nestedSecond)
AuditWorkUnit
merge(ModWorkUnit second)
-
Methods inherited from class org.hibernate.envers.internal.synchronization.work.AbstractAuditWorkUnit
fillDataWithId, getEntityId, getEntityName, getRevisionType, isPerformed, perform, 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, perform, undo
-
-
-
-
Constructor Detail
-
FakeBidirectionalRelationWorkUnit
public FakeBidirectionalRelationWorkUnit(SessionImplementor sessionImplementor, String entityName, EnversService enversService, Serializable id, String referencingPropertyName, Object owningEntity, RelationDescription rd, RevisionType revisionType, Object index, AuditWorkUnit nestedWorkUnit)
-
FakeBidirectionalRelationWorkUnit
public FakeBidirectionalRelationWorkUnit(FakeBidirectionalRelationWorkUnit original, Map<String,org.hibernate.envers.internal.synchronization.work.FakeBidirectionalRelationWorkUnit.FakeRelationChange> fakeRelationChanges, AuditWorkUnit nestedWorkUnit)
-
FakeBidirectionalRelationWorkUnit
public FakeBidirectionalRelationWorkUnit(FakeBidirectionalRelationWorkUnit original, AuditWorkUnit nestedWorkUnit)
-
-
Method Detail
-
getNestedWorkUnit
public AuditWorkUnit getNestedWorkUnit()
-
getFakeRelationChanges
public Map<String,org.hibernate.envers.internal.synchronization.work.FakeBidirectionalRelationWorkUnit.FakeRelationChange> getFakeRelationChanges()
-
containsWork
public boolean containsWork()
- Specified by:
containsWork
in interfaceAuditWorkUnit
-
generateData
public Map<String,Object> generateData(Object revisionData)
- Specified by:
generateData
in 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.
-
merge
public AuditWorkUnit merge(AddWorkUnit second)
- Specified by:
merge
in interfaceWorkUnitMergeVisitor
-
merge
public AuditWorkUnit merge(ModWorkUnit second)
- Specified by:
merge
in interfaceWorkUnitMergeVisitor
-
merge
public AuditWorkUnit merge(DelWorkUnit second)
- Specified by:
merge
in interfaceWorkUnitMergeVisitor
-
merge
public AuditWorkUnit merge(CollectionChangeWorkUnit second)
- Specified by:
merge
in interfaceWorkUnitMergeVisitor
-
merge
public AuditWorkUnit merge(FakeBidirectionalRelationWorkUnit second)
- Specified by:
merge
in interfaceWorkUnitMergeVisitor
-
dispatch
public AuditWorkUnit dispatch(WorkUnitMergeVisitor first)
Description copied from interface:WorkUnitMergeDispatcher
Should be invoked on the second work unit.- Specified by:
dispatch
in interfaceWorkUnitMergeDispatcher
- Parameters:
first
- First work unit (that is, the one added earlier).- Returns:
- The work unit that is the result of the merge.
-
merge
public static AuditWorkUnit merge(FakeBidirectionalRelationWorkUnit frwu, AuditWorkUnit nestedFirst, AuditWorkUnit nestedSecond)
-
-