Interface SessionFactoryManager
- All Known Implementing Classes:
SessionFactoryManagerImpl
public interface SessionFactoryManager
Manages hibernate session.
See implementation for details.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(SessionFactoryManagerListener listener) void
Bind the givenSession
to the current thread.void
void
InvokesSessionFactoryManagerListener
instances and then closes theSession
.Creates and returns a newSession
.createNewSession
(Integer queryTimeout) createNewSession
(Connection connection) createNewSession
(Connection connection, Integer queryTimeout) void
Detach the givenSession
from the current thread.Returns theSession
that is bound to the current thread.@Nullable PersistenceSessionImplementor
Returns the implicitSession
for the current thread.boolean
loadEntityClassByName
(String entityName) void
removeListener
(SessionFactoryManagerListener listener)
-
Method Details
-
getImplicitSession
Returns the implicitSession
for the current thread. This may return null if the implicit session has not been initialized yet. -
getCurrentSession
PersistenceSessionImplementor getCurrentSession()Returns theSession
that 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 givenSession
to the current thread. -
detachSessionFromThread
Detach the givenSession
from the current thread. -
isAttachedToThread
- Returns:
- true if the given
Session
is bound to the current thread.
-
closeSession
InvokesSessionFactoryManagerListener
instances and then closes theSession
. All sessions should be closed through this method. -
clearImplicitSession
void clearImplicitSession() -
addListener
-
removeListener
-
loadEntityClassByName
-