Hibernate 4.0.0Final where is the SessionFactory.openSession(Interceptor interceptor)

前端 未结 1 1169
小鲜肉
小鲜肉 2021-02-20 15:13

I try some code from hibernate 4.0 interceptors, which gives this code for use session-level interceptors:

Session session = sf.openSession( new AuditInterceptor         


        
相关标签:
1条回答
  • 2021-02-20 15:29

    It's implemented using Builder pattern now:

    Session session = sf.withOptions()
                        .interceptor(new AuditInterceptor())
                        .openSession(); 
    
    0 讨论(0)
提交回复
热议问题