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.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(Object entity, Serializable id, Object[] currentState, Object[] previousState, 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[])
public void onCollectionRecreate(Object collection, Serializable key) throws org.hibernate.CallbackException
onCollectionRecreate
in interface org.hibernate.Interceptor
onCollectionRecreate
in class org.hibernate.EmptyInterceptor
org.hibernate.CallbackException
public void onCollectionUpdate(Object collection, Serializable key) throws org.hibernate.CallbackException
onCollectionUpdate
in interface org.hibernate.Interceptor
onCollectionUpdate
in class org.hibernate.EmptyInterceptor
org.hibernate.CallbackException
public void onCollectionRemove(Object collection, Serializable key) throws org.hibernate.CallbackException
onCollectionRemove
in interface org.hibernate.Interceptor
onCollectionRemove
in class org.hibernate.EmptyInterceptor
org.hibernate.CallbackException
Copyright © 2024 OpenMRS Inc.. All rights reserved.