Interface PersistenceSession
- All Known Subinterfaces:
PersistenceSessionImplementor
- All Known Implementing Classes:
PersistenceSessionImpl
public interface PersistenceSession
Representation of a JPA Session to allow session-scoped functionality without
exposing the actual JPA/Hibernate classes.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddCleanupAction(Runnable runnable) Register a runnable that will be executed after this session was closed.voidaddCommitListener(CommitListener listener) Register aCommitListenerfor this session.voidaddEntityFacadeListener(EntityFacadeListener listener) voidaddEntityListener(EntityListener listener) voidaddTransactionListener(TransactionListener listener) Add aTransactionListenerthat will be added to all transactions that will be started in this session.voidclear()Clear the underlying hibernate session.<T> TgetAttribute(String key) booleanisOpen()voidremoveCommitListener(CommitListener listener) Remove aCommitListener.voidvoidremoveEntityListener(EntityListener listener) voidremoveTransactionListener(TransactionListener listener) Remove aTransactionListenerfor the session.voidsetAttribute(String key, Object value) voidsetQueryTimeout(int queryTimeout)
-
Method Details
-
isOpen
boolean isOpen()- Returns:
- true is the ssesion is open and usable
-
addCleanupAction
Register a runnable that will be executed after this session was closed. -
clear
void clear()Clear the underlying hibernate session. -
getCacheControl
CacheControl getCacheControl() -
setQueryTimeout
void setQueryTimeout(int queryTimeout) -
getQueryTimeout
-
setAttribute
-
getAttribute
-
addEntityFacadeListener
-
removeEntityFacadeListener
-
addEntityListener
-
removeEntityListener
-
addTransactionListener
Add aTransactionListenerthat will be added to all transactions that will be started in this session. -
removeTransactionListener
Remove aTransactionListenerfor the session. -
addCommitListener
Register aCommitListenerfor this session. -
removeCommitListener
Remove aCommitListener.
-