Make delicious recipes!

Hibernate Interceptor

Applications can extend EmptyInterceptor to implement a whole bunch of functionality.
Dirty checking example shows one way how this can be done.
The Interceptor defines another method which can be used to do dirty-checking in a much easier (though a little crude) way.
This can be done by overriding the method:
* Called from flush(). The return value determines whether the entity is updated:
* 1) An array of property indices - the entity is dirty
* 2) An empty array - the entity is not dirty
* 3) null - use Hibernate's default dirty-checking algorithm
* The arrays passed here refer to the table-columns (class-fields) and the return array should
* contain the indexes of those properties that have changed.
int [] findDirty (Object entity, Serializable id, 
    Object[] currentState, 
    Object[] previousState,
    String[] propertyNames,
    Type[] types)

Like us on Facebook to remain in touch
with the latest in technology and tutorials!

Got a thought to share or found a
bug in the code?
We'd love to hear from you:

Email: (Your email is not shared with anybody)

Facebook comments:

Site Owner: Sachin Goyal