Serializable
public class TimestampInterceptor
extends org.hibernate.EmptyInterceptor
createDate
and lastModifiedDate
of any AbstractEntity instance that is
inserted or updated.Constructor | Description |
---|---|
TimestampInterceptor() |
Modifier and Type | Method | Description |
---|---|---|
boolean |
onFlushDirty(Object entity,
Serializable id,
Object[] currentState,
Object[] previousState,
String[] propertyNames,
org.hibernate.type.Type[] types) |
Called before updating the datastore.
|
boolean |
onSave(Object entity,
Serializable id,
Object[] state,
String[] propertyNames,
org.hibernate.type.Type[] types) |
Called before inserting an item in the datastore.
|
afterTransactionBegin, afterTransactionCompletion, beforeTransactionCompletion, findDirty, getEntity, getEntityName, instantiate, isTransient, onCollectionRecreate, onCollectionRemove, onCollectionUpdate, onDelete, onLoad, onPrepareStatement, postFlush, preFlush
public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, org.hibernate.type.Type[] types)
The interceptor may modify the state, which will be used for the SQL INSERT and propagated to the persistent object.
Automatically sets the createDate and lastModifiedDate properties.
onSave
in class org.hibernate.EmptyInterceptor
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, org.hibernate.type.Type[] types)
Called when an object is detected to be dirty, during a flush.
The interceptor may modify the detected currentState, which will be
propagated to both the database and the persistent object.
Note that not all flushes end in actual synchronization
with the database, in which case the new currentState will be
propagated to the object, but not necessarily (immediately)
to the database. It is strongly recommended that the interceptor
not modify the previousState.
Automatically sets the lastModifiedDate property.
onFlushDirty
in class org.hibernate.EmptyInterceptor
Copyright © 2002–2019 itracker. All rights reserved.