|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.EmptyInterceptor org.openmrs.api.db.hibernate.AuditableInterceptor
public class AuditableInterceptor
This class looks for Auditable
that are being inserted into the database. When found, if
the class is an update (instead of an insert) then the changedBy and dateChanged fields are set
to the current user and the current time.
This class replaces the logic that was in the AuditableSaveHandler. It is here so that the
cascading does NOT happen for dateChanged/changedBy to child OpenmrsObjects (because all handlers
recurse on lists of OpenmrsObjects.
Field Summary |
---|
Fields inherited from class org.hibernate.EmptyInterceptor |
---|
INSTANCE |
Constructor Summary | |
---|---|
AuditableInterceptor()
|
Method Summary | |
---|---|
boolean |
onFlushDirty(java.lang.Object entity,
java.io.Serializable id,
java.lang.Object[] currentState,
java.lang.Object[] previousState,
java.lang.String[] propertyNames,
org.hibernate.type.Type[] types)
This class method is only called when flushing an updated dirty object, not inserting objects |
Methods inherited from class org.hibernate.EmptyInterceptor |
---|
afterTransactionBegin, afterTransactionCompletion, beforeTransactionCompletion, findDirty, getEntity, getEntityName, instantiate, isTransient, onCollectionRecreate, onCollectionRemove, onCollectionUpdate, onDelete, onLoad, onPrepareStatement, onSave, postFlush, preFlush |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AuditableInterceptor()
Method Detail |
---|
public boolean onFlushDirty(java.lang.Object entity, java.io.Serializable id, java.lang.Object[] currentState, java.lang.Object[] previousState, java.lang.String[] propertyNames, org.hibernate.type.Type[] types) throws org.hibernate.CallbackException
onFlushDirty
in interface org.hibernate.Interceptor
onFlushDirty
in class org.hibernate.EmptyInterceptor
org.hibernate.CallbackException
EmptyInterceptor.onFlushDirty(java.lang.Object, java.io.Serializable, java.lang.Object[], java.lang.Object[], java.lang.String[], org.hibernate.type.Type[])
|
OpenMRS-1.7.x | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |