Etwa so:
Code:
public class HistoryInterceptor extends EmptyInterceptor {
(...)
/**
* Called when an object is detected to be dirty, during a flush. The interceptor may modify the detected
* <tt>currentState</tt>, 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 <tt>currentState</tt> will be propagated to the object, but not necessarily (immediately) to
* the database. It is strongly recommended that the interceptor <b>not</b> modify the <tt>previousState</tt>.
*
* @return <tt>true</tt> if the user modified the <tt>currentState</tt> in any way.
*/
@Override
public boolean onFlushDirty(final Object pEntity,
final Serializable pId,
final Object[] pCurrentState,
final Object[] pPreviousState,
final String[] pPropertyNames,
final Type[] pTypes) throws CallbackException {
// there must no exception be uncaught here!
try {
final String entityName = pEntity.getClass().getCanonicalName();
(...)
Ich hoffe, das hilft.
Carlo
--------------------------------------
please give me credits if this helped you.