org.hibernate.envers.synchronization.work
Class AbstractAuditWorkUnit

java.lang.Object
  extended by org.hibernate.envers.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

Author:
Adam Warski (adam at warski dot org)

Field Summary
protected  String entityName
           
protected  Serializable id
           
protected  SessionImplementor sessionImplementor
           
protected  AuditConfiguration verCfg
           
 
Constructor Summary
protected AbstractAuditWorkUnit(SessionImplementor sessionImplementor, String entityName, AuditConfiguration verCfg, Serializable id)
           
 
Method Summary
protected  void fillDataWithId(Map<String,Object> data, Object revision, RevisionType revisionType)
           
 Object getEntityId()
           
 String getEntityName()
           
 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.synchronization.work.AuditWorkUnit
containsWork, generateData
 
Methods inherited from interface org.hibernate.envers.synchronization.work.WorkUnitMergeVisitor
merge, merge, merge, merge, merge
 
Methods inherited from interface org.hibernate.envers.synchronization.work.WorkUnitMergeDispatcher
dispatch
 

Field Detail

sessionImplementor

protected final SessionImplementor sessionImplementor

verCfg

protected final AuditConfiguration verCfg

id

protected final Serializable id

entityName

protected final String entityName
Constructor Detail

AbstractAuditWorkUnit

protected AbstractAuditWorkUnit(SessionImplementor sessionImplementor,
                                String entityName,
                                AuditConfiguration verCfg,
                                Serializable id)
Method Detail

fillDataWithId

protected void fillDataWithId(Map<String,Object> data,
                              Object revision,
                              RevisionType revisionType)

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 interface AuditWorkUnit
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 interface AuditWorkUnit

isPerformed

public boolean isPerformed()
Specified by:
isPerformed in interface AuditWorkUnit

getEntityName

public String getEntityName()
Specified by:
getEntityName in interface AuditWorkUnit

setPerformed

protected void setPerformed(Object performedData)

undo

public void undo(Session session)
Specified by:
undo in interface AuditWorkUnit


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