open class OpenSessionInterceptor : MethodInterceptor, InitializingBean
Simple AOP Alliance MethodInterceptor implementation that binds a new Hibernate Session for each method invocation, if none bound before.
This is a simple Hibernate Session scoping interceptor along the lines of OpenSessionInViewInterceptor, just for use with AOP setup instead of MVC setup. It opens a new Session with flush mode "MANUAL" since the Session is only meant for reading, except when participating in a transaction.
Author
Juergen Hoeller
Since
4.2
See Also
OpenSessionInViewInterceptorOpenSessionInViewFilterorg.springframework.orm.hibernate5.HibernateTransactionManagerTransactionSynchronizationManagerSessionFactory#getCurrentSession()
OpenSessionInterceptor()
Simple AOP Alliance MethodInterceptor implementation that binds a new Hibernate Session for each method invocation, if none bound before. This is a simple Hibernate Session scoping interceptor along the lines of OpenSessionInViewInterceptor, just for use with AOP setup instead of MVC setup. It opens a new Session with flush mode "MANUAL" since the Session is only meant for reading, except when participating in a transaction. |
open fun afterPropertiesSet(): Unit |
|
open fun getSessionFactory(): SessionFactory
Return the Hibernate SessionFactory that should be used to create Hibernate Sessions. |
|
open fun invoke(invocation: MethodInvocation): Any |
|
open fun setSessionFactory(sessionFactory: SessionFactory): Unit
Set the Hibernate SessionFactory that should be used to create Hibernate Sessions. |