public final class MicronautSessionContext
extends java.lang.Object
implements org.hibernate.context.spi.CurrentSessionContext
CurrentSessionContext interface
that delegates to SessionFactoryUtils for providing a
current Session.
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.
| Constructor and Description |
|---|
MicronautSessionContext(org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)
Create a new SpringSessionContext for the given Hibernate SessionFactory.
|
| Modifier and Type | Method and Description |
|---|---|
org.hibernate.Session |
currentSession()
Retrieve the Spring-managed Session for the current thread, if any.
|
public MicronautSessionContext(org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)
sessionFactory - the SessionFactory to provide current Sessions forpublic org.hibernate.Session currentSession()
throws org.hibernate.HibernateException
currentSession in interface org.hibernate.context.spi.CurrentSessionContextorg.hibernate.HibernateException