org.hibernate.test.interceptor
Class PropertyInterceptor

java.lang.Object
  extended by org.hibernate.EmptyInterceptor
      extended by org.hibernate.test.interceptor.PropertyInterceptor
All Implemented Interfaces:
Serializable, Interceptor

public class PropertyInterceptor
extends EmptyInterceptor

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.hibernate.EmptyInterceptor
INSTANCE
 
Constructor Summary
PropertyInterceptor()
           
 
Method Summary
 boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types)
          Called when an object is detected to be dirty, during a flush.
 boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types)
          Called before an object is saved.
 
Methods inherited from class org.hibernate.EmptyInterceptor
afterTransactionBegin, afterTransactionCompletion, beforeTransactionCompletion, findDirty, getEntity, getEntityName, instantiate, isTransient, onCollectionRecreate, onCollectionRemove, onCollectionUpdate, onDelete, onLoad, onPrepareStatement, postFlush, preFlush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyInterceptor

public PropertyInterceptor()
Method Detail

onFlushDirty

public boolean onFlushDirty(Object entity,
                            Serializable id,
                            Object[] currentState,
                            Object[] previousState,
                            String[] propertyNames,
                            Type[] types)
Description copied from interface: 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.

Specified by:
onFlushDirty in interface Interceptor
Overrides:
onFlushDirty in class EmptyInterceptor
Returns:
true if the user modified the currentState in any way.

onSave

public boolean onSave(Object entity,
                      Serializable id,
                      Object[] state,
                      String[] propertyNames,
                      Type[] types)
Description copied from interface: 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.

Specified by:
onSave in interface Interceptor
Overrides:
onSave in class EmptyInterceptor
Returns:
true if the user modified the state in any way.


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.