public class AuditableInterceptor
extends org.hibernate.EmptyInterceptor
OpenmrsObject
and Auditable
that are being inserted into the
database. The creator and dateCreated fields are set when inserting or updating objects and the
fields are still null. 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. Constructor and Description |
---|
AuditableInterceptor() |
Modifier and Type | Method and Description |
---|---|
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
|
boolean |
onSave(java.lang.Object entity,
java.io.Serializable id,
java.lang.Object[] currentState,
java.lang.String[] propertyNames,
org.hibernate.type.Type[] types)
This method is only called when inserting new objects.
|
afterTransactionBegin, afterTransactionCompletion, beforeTransactionCompletion, findDirty, getEntity, getEntityName, instantiate, isTransient, onCollectionRecreate, onCollectionRemove, onCollectionUpdate, onDelete, onLoad, onPrepareStatement, postFlush, preFlush
public boolean onSave(java.lang.Object entity, java.io.Serializable id, java.lang.Object[] currentState, java.lang.String[] propertyNames, org.hibernate.type.Type[] types)
onSave
in interface org.hibernate.Interceptor
onSave
in class org.hibernate.EmptyInterceptor
EmptyInterceptor.onSave(java.lang.Object, java.io.Serializable,
java.lang.Object[], java.lang.String[], org.hibernate.type.Type[])
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[])
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.