(아마도 Hibernate 3.3부터 추가된) onPrepareStatement 를 통해 쿼리를 변경하는것이 가능하다.
http://www.mkyong.com/hibernate/hibernate-interceptor-example-audit-log/
with JPA
JPA에서는 hibernate.ejb.interceptorhibernate.session_factory.interceptor, hibernate.session_factory.session_scoped_interceptor프라퍼티에 Interceptor의 FQCN을 지정해주면된다.
hibernate.session_factory.interceptor 는 모든 세션에 대해 하나의 interceptor 객체로 적용된다.hibernate.session_factory.session_scoped_interceptor : 세션별로 새로운 interceptor 객체를 생성한다.