StatefulInterceptorpublic class StatefulInterceptor extends org.hibernate.EmptyInterceptor
Fields Summary |
---|
private org.hibernate.Session | session | private List | list |
Methods Summary |
---|
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)
if ( !(entity instanceof Log) ) {
list.add( new Log( "update", (String) id, entity.getClass().getName() ) );
}
return false;
| public boolean | onSave(java.lang.Object entity, java.io.Serializable id, java.lang.Object[] state, java.lang.String[] propertyNames, org.hibernate.type.Type[] types)
if ( !(entity instanceof Log) ) {
list.add( new Log( "insert", (String) id, entity.getClass().getName() ) );
}
return false;
| public void | postFlush(java.util.Iterator entities)
if ( list.size()>0 ) {
for ( Iterator iter = list.iterator(); iter.hasNext(); ) {
session.persist( iter.next() );
}
list.clear();
session.flush();
}
| public void | setSession(org.hibernate.Session s)
session = s;
|
|