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