I try some code from hibernate 4.0 interceptors, which gives this code for use session-level interceptors:
Session session = sf.openSession( new AuditInterceptor() );
however, I check both the hibernate-core 4.0 source code and onlie hibernate 4.0 java-doc, the class SessionFactory does not have method openSession(Interceptor interceptor) , but hibernate 3.6 java-doc do have this method.
anyone knows where is the method move to? if deprecated, why the document still keeps it in tutorial document? and how should I use session-level interceptor in 4.0?
It’s implemented using Builder pattern now: