EntityManager « Interceptor « JPA Q&A





1. EntityManager query and Interceptor    forum.hibernate.org

Hi, I'm trying to use a Custom Interceptor but I'm not seeing the onLoad() method getting called. I have a query created using an EntityManager and I did a getSingleResult() from the query. The onLoad() method of my custom Interceptor doesn't get called. I did see onSave() and onDelete() being called when I persist() or remove() entities. Is this an expected ...

2. How to use Hibernate Interceptor in JPA apis(EntityManager)?    forum.hibernate.org

hi all. i use Spring2.5, JPA(EntityManager) and hibernate to build my application. we have a demand that we must generate audit log for each dao method. JPA's callback and listener is too simple to do this and it seems hibernate interceptor must be used in Configuration, sessionFactory these non-JPA APIs. my current solution is using spring aop but it can't keep ...

3. Getting Session or EntityManager inside interceptor    forum.hibernate.org

Hello, I have searched this forum and googled around and I have found many questions but not a single answer to this question: "How to get Session or EntityManager inside interceptor in managed environments". The typical use case is an audit interceptor that should persist changes to entities. Interceptors are perfect to capture the changes, but the problem is how to ...