Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/hibernate/test/interceptor/CollectionInterceptor.java


1   //$Id: CollectionInterceptor.java 7700 2005-07-30 05:02:47Z oneovthafew $
2   package org.hibernate.test.interceptor;
3   
4   import java.io.Serializable;
5   
6   import org.hibernate.EmptyInterceptor;
7   import org.hibernate.type.Type;
8   
9   public class CollectionInterceptor extends EmptyInterceptor {
10  
11    public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) {
12      ( (User) entity ).getActions().add("updated");
13      return false;
14    }
15  
16    public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) {
17      ( (User) entity ).getActions().add("created");
18      return false;
19    }
20  
21  }