|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.orm.hibernate3.SpringSessionContext
public class SpringSessionContext
Implementation of Hibernate 3.1's CurrentSessionContext interface that delegates to Spring's SessionFactoryUtils for providing a Spring-managed current Session.
Used by Spring's LocalSessionFactoryBean if told to expose a transaction-aware SessionFactory.
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.
SessionFactoryUtils.doGetSession(org.hibernate.SessionFactory, boolean)
,
AbstractSessionFactoryBean.setExposeTransactionAwareSessionFactory(boolean)
,
Serialized FormConstructor Summary | |
---|---|
SpringSessionContext(SessionFactoryImplementor sessionFactory)
Create a new SpringSessionContext for the given Hibernate SessionFactory. |
Method Summary | |
---|---|
Session |
currentSession()
Retrieve the Spring-managed Session for the current thread, if any. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SpringSessionContext(SessionFactoryImplementor sessionFactory)
sessionFactory
- the SessionFactory to provide current Sessions forMethod Detail |
---|
public Session currentSession() throws HibernateException
currentSession
in interface CurrentSessionContext
HibernateException
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |