【Java开源代码栏目提醒】:网学会员为广大网友收集整理了,CollectionInterceptor.java,希望对大家有所帮助!
//$Id: CollectionInterceptor.java 7700 2005-07-30 05:02:47Z oneovthafew $
package org.hibernate.test.interceptor;
import java.io.Serializable;
import org.hibernate.EmptyInterceptor;
import org.hibernate.type.Type;
public class CollectionInterceptor extends EmptyInterceptor {
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) {
( (User) entity ).getActions().add("updated");
return false;
}
public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) {
( (User) entity ).getActions().add("created");
return false;
}
}
上一篇:
CollectionInitializer.java
下一篇:
恋沫