Class MicronautSessionContext
- java.lang.Object
- 
- io.micronaut.transaction.hibernate5.MicronautSessionContext
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- org.hibernate.context.spi.CurrentSessionContext
 
 public final class MicronautSessionContext extends java.lang.Object implements org.hibernate.context.spi.CurrentSessionContextImplementation of Hibernate 3.1'sCurrentSessionContextinterface that delegates toSessionFactoryUtilsfor providing a currentSession.This CurrentSessionContext implementation can also be specified in custom SessionFactory setup through the "hibernate.current_session_context_class" property, with the fully qualified name of this class as value. - Since:
- 4.2
- Author:
- Juergen Hoeller, graemerocher
- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description MicronautSessionContext(org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)Create a new SpringSessionContext for the given Hibernate SessionFactory.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description org.hibernate.SessioncurrentSession()Retrieve the Spring-managed Session for the current thread, if any.
 
- 
- 
- 
Method Detail- 
currentSessionpublic org.hibernate.Session currentSession() throws org.hibernate.HibernateExceptionRetrieve the Spring-managed Session for the current thread, if any.- Specified by:
- currentSessionin interface- org.hibernate.context.spi.CurrentSessionContext
- Throws:
- org.hibernate.HibernateException
 
 
- 
 
-