java.lang.Object
org.hibernate.EmptyInterceptor
org.hibernate.test.interceptor.StatefulInterceptor
- All Implemented Interfaces:
- org.hibernate.Interceptor, java.io.Serializable
- public class StatefulInterceptor
- extends org.hibernate.EmptyInterceptor
|
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)
Called when an object is detected to be dirty, during a flush. |
boolean |
onSave(java.lang.Object entity,
java.io.Serializable id,
java.lang.Object[] state,
java.lang.String[] propertyNames,
org.hibernate.type.Type[] types)
Called before an object is saved. |
void |
postFlush(java.util.Iterator entities)
Called after a flush that actually ends in execution of the SQL statements required to synchronize
in-memory state with the database. |
void |
setSession(org.hibernate.Session s)
|
| Methods inherited from class org.hibernate.EmptyInterceptor |
afterTransactionBegin, afterTransactionCompletion, beforeTransactionCompletion, findDirty, getEntity, getEntityName, instantiate, isTransient, onCollectionRecreate, onCollectionRemove, onCollectionUpdate, onDelete, onLoad, onPrepareStatement, preFlush |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
session
private org.hibernate.Session session
list
private java.util.List list
StatefulInterceptor
public StatefulInterceptor()
onSave
public boolean onSave(java.lang.Object entity,
java.io.Serializable id,
java.lang.Object[] state,
java.lang.String[] propertyNames,
org.hibernate.type.Type[] types)
- Description copied from interface:
org.hibernate.Interceptor
- Called before an object is saved. The interceptor may modify the state, which will be used for
the SQL INSERT and propagated to the persistent object.
onFlushDirty
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)
- Description copied from interface:
org.hibernate.Interceptor
- 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.
postFlush
public void postFlush(java.util.Iterator entities)
- Description copied from interface:
org.hibernate.Interceptor
- Called after a flush that actually ends in execution of the SQL statements required to synchronize
in-memory state with the database.
setSession
public void setSession(org.hibernate.Session s)