Class AbstractAuditWorkUnit
- java.lang.Object
-
- org.hibernate.envers.internal.synchronization.work.AbstractAuditWorkUnit
-
- All Implemented Interfaces:
AuditWorkUnit
,WorkUnitMergeDispatcher
,WorkUnitMergeVisitor
- Direct Known Subclasses:
AddWorkUnit
,CollectionChangeWorkUnit
,DelWorkUnit
,FakeBidirectionalRelationWorkUnit
,ModWorkUnit
,PersistentCollectionChangeWorkUnit
public abstract class AbstractAuditWorkUnit extends Object implements AuditWorkUnit
-
-
Field Summary
Fields Modifier and Type Field Description protected AuditStrategy
auditStrategy
protected String
entityName
protected EnversService
enversService
protected Object
id
protected RevisionType
revisionType
protected SessionImplementor
sessionImplementor
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractAuditWorkUnit(SessionImplementor sessionImplementor, String entityName, EnversService enversService, Object id, RevisionType revisionType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
fillDataWithId(Map<String,Object> data, Object revision)
Object
getEntityId()
String
getEntityName()
RevisionType
getRevisionType()
boolean
isPerformed()
void
perform(Session session, Object revisionData)
Perform this work unit in the given session.protected void
setPerformed(Object performedData)
void
undo(Session session)
-
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
containsWork, generateData
-
Methods inherited from interface org.hibernate.envers.internal.synchronization.work.WorkUnitMergeDispatcher
dispatch
-
-
-
-
Field Detail
-
sessionImplementor
protected final SessionImplementor sessionImplementor
-
enversService
protected final EnversService enversService
-
id
protected final Object id
-
entityName
protected final String entityName
-
auditStrategy
protected final AuditStrategy auditStrategy
-
revisionType
protected final RevisionType revisionType
-
-
Constructor Detail
-
AbstractAuditWorkUnit
protected AbstractAuditWorkUnit(SessionImplementor sessionImplementor, String entityName, EnversService enversService, Object id, RevisionType revisionType)
-
-
Method Detail
-
perform
public void perform(Session session, Object revisionData)
Description copied from interface:AuditWorkUnit
Perform this work unit in the given session.- Specified by:
perform
in interfaceAuditWorkUnit
- 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.
-
getEntityId
public Object getEntityId()
- Specified by:
getEntityId
in interfaceAuditWorkUnit
-
isPerformed
public boolean isPerformed()
- Specified by:
isPerformed
in interfaceAuditWorkUnit
-
getEntityName
public String getEntityName()
- Specified by:
getEntityName
in interfaceAuditWorkUnit
-
setPerformed
protected void setPerformed(Object performedData)
-
undo
public void undo(Session session)
- Specified by:
undo
in interfaceAuditWorkUnit
-
getRevisionType
public RevisionType getRevisionType()
- Specified by:
getRevisionType
in interfaceAuditWorkUnit
- Returns:
- Performed modification type.
-
-