Seam « Interceptor « JPA Q&A





1. Configuring Hibernate Interceptor with Seam    seamframework.org

2. Hibernate Interceptor in Seam    seamframework.org

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; } }

3. Is it possible to specify per-session Hibernate interceptor...    seamframework.org

My goal is to log entity changes with a Hibernate interceptor (thru its event listener setup) for each managed session that I have running when the session is flushed and committed. According to the Hibernate docs, the session interceptor can be specified as one that all sessions use (so must be thread-safe) or as per-session. Is per-session possible with a managed ...