FileDocCategorySizeDatePackage
StatefulInterceptor.javaAPI DocHibernate 3.2.51264Sat Jul 30 00:07:02 BST 2005org.hibernate.test.interceptor

StatefulInterceptor

public class StatefulInterceptor extends org.hibernate.EmptyInterceptor

Fields Summary
private org.hibernate.Session
session
private List
list
Constructors Summary
Methods Summary
public booleanonFlushDirty(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 booleanonSave(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 voidpostFlush(java.util.Iterator entities)

		if ( list.size()>0 ) {
			for ( Iterator iter = list.iterator(); iter.hasNext(); ) {
				session.persist( iter.next() );	
			}
			list.clear();
			session.flush();
		}
	
public voidsetSession(org.hibernate.Session s)

		session = s;