This content has been marked as final.
Show 1 reply
-
1. Re: Hibernate Interceptor in Seam
atonse Jul 7, 2009 3:10 PM (in response to bvphadnis.bvphadnis.gmail.com)The way I did it:
- Create a class that extends org.hibernate.EmptyInterceptor.
package myapp.service.util; import java.io.Serializable; import org.hibernate.CallbackException; import org.hibernate.EmptyInterceptor; import org.hibernate.type.Type; public class EntityInterceptor extends EmptyInterceptor { @Override public void onCollectionUpdate(Object collection, Serializable key) throws CallbackException { super.onCollectionUpdate(collection, key); } @Override public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) { boolean changed = false; /* put any changes on save here */ return changed; } }
- Configure it in your persistence file with the following line:
<property name="hibernate.ejb.interceptor" value="myapp.service.util.EntityInterceptor" />