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 |
|---|---|
void |
onCollectionRecreate(Object collection,
Serializable key) |
void |
onCollectionRemove(Object collection,
Serializable key) |
void |
onCollectionUpdate(Object collection,
Serializable key) |
boolean |
onFlushDirty(Object entity,
Serializable id,
Object[] currentState,
Object[] previousState,
String[] propertyNames,
org.hibernate.type.Type[] types)
This class method is only called when flushing an updated dirty object, not inserting objects
|
boolean |
onSave(Object entity,
Serializable id,
Object[] entityCurrentState,
String[] propertyNames,
org.hibernate.type.Type[] types)
This method is only called when inserting new objects.
|
public boolean onSave(Object entity, Serializable id, Object[] entityCurrentState, String[] propertyNames, org.hibernate.type.Type[] types)
onSave in interface org.hibernate.InterceptoronSave in class org.hibernate.EmptyInterceptorEmptyInterceptor.onSave(java.lang.Object, java.io.Serializable,
java.lang.Object[], java.lang.String[], org.hibernate.type.Type[])public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, org.hibernate.type.Type[] types) throws org.hibernate.CallbackException
onFlushDirty in interface org.hibernate.InterceptoronFlushDirty in class org.hibernate.EmptyInterceptororg.hibernate.CallbackExceptionEmptyInterceptor.onFlushDirty(java.lang.Object, java.io.Serializable,
java.lang.Object[], java.lang.Object[], java.lang.String[], org.hibernate.type.Type[])public void onCollectionRecreate(Object collection, Serializable key) throws org.hibernate.CallbackException
onCollectionRecreate in interface org.hibernate.InterceptoronCollectionRecreate in class org.hibernate.EmptyInterceptororg.hibernate.CallbackExceptionpublic void onCollectionUpdate(Object collection, Serializable key) throws org.hibernate.CallbackException
onCollectionUpdate in interface org.hibernate.InterceptoronCollectionUpdate in class org.hibernate.EmptyInterceptororg.hibernate.CallbackExceptionpublic void onCollectionRemove(Object collection, Serializable key) throws org.hibernate.CallbackException
onCollectionRemove in interface org.hibernate.InterceptoronCollectionRemove in class org.hibernate.EmptyInterceptororg.hibernate.CallbackExceptionCopyright © 2024 OpenMRS Inc.. All rights reserved.