Interface SessionFactoryManager
- All Known Implementing Classes:
SessionFactoryManagerImpl
public interface SessionFactoryManager
Manages hibernate session.
See implementation for details.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(SessionFactoryManagerListener listener) voidBind the givenSessionto the current thread.voidvoidInvokesSessionFactoryManagerListenerinstances and then closes theSession.Creates and returns a newSession.createNewSession(Integer queryTimeout) createNewSession(Connection connection) createNewSession(Connection connection, Integer queryTimeout) voidDetach the givenSessionfrom the current thread.Returns theSessionthat is bound to the current thread.@Nullable PersistenceSessionImplementorReturns the implicitSessionfor the current thread.booleanloadEntityClassByName(String entityName) voidremoveListener(SessionFactoryManagerListener listener)
-
Method Details
-
getImplicitSession
Returns the implicitSessionfor the current thread. This may return null if the implicit session has not been initialized yet. -
getCurrentSession
PersistenceSessionImplementor getCurrentSession()Returns theSessionthat is bound to the current thread. If no session is bound to the current thread, the implicit session is created (if it does not exist yet) and returned. -
createNewSession
PersistenceSessionImplementor createNewSession()Creates and returns a newSession. The new session will automatically bound to the current thread. If this session will be closed, it will automatically be detached from the current thread and it is attempted to re-attach the previous session. -
createNewSession
-
createNewSession
-
createNewSession
-
attachSessionToThread
Bind the givenSessionto the current thread. -
detachSessionFromThread
Detach the givenSessionfrom the current thread. -
isAttachedToThread
- Returns:
- true if the given
Sessionis bound to the current thread.
-
closeSession
InvokesSessionFactoryManagerListenerinstances and then closes theSession. All sessions should be closed through this method. -
clearImplicitSession
void clearImplicitSession() -
addListener
-
removeListener
-
loadEntityClassByName
-