类 SpringSessionContext
- java.lang.Object
- org.springframework.orm.hibernate4.SpringSessionContext
- 所有已实现的接口:
Serializable
,CurrentSessionContext
public class SpringSessionContext extends Object implements CurrentSessionContext
Implementation of Hibernate 3.1's CurrentSessionContext interface that delegates to Spring's SessionFactoryUtils for providing a Spring-managed 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.
- 从以下版本开始:
- 3.1
- 作者:
- Juergen Hoeller
- 另请参阅:
- 序列化表格
构造器概要
构造器 构造器 说明 SpringSessionContext(SessionFactoryImplementor sessionFactory)
Create a new SpringSessionContext for the given Hibernate SessionFactory.
构造器详细资料
SpringSessionContext
public SpringSessionContext(SessionFactoryImplementor sessionFactory)
Create a new SpringSessionContext for the given Hibernate SessionFactory.- 参数:
sessionFactory
- the SessionFactory to provide current Sessions for
方法详细资料
currentSession
public Session currentSession() throws HibernateException
Retrieve the Spring-managed Session for the current thread, if any.