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 TypeMethodDescriptionvoid
addCleanupAction
(Runnable runnable) Register a runnable that will be executed after this session was closed.void
addCommitListener
(CommitListener listener) Register aCommitListener
for this session.void
addEntityFacadeListener
(EntityFacadeListener listener) void
addEntityListener
(EntityListener listener) void
addTransactionListener
(TransactionListener listener) Add aTransactionListener
that will be added to all transactions that will be started in this session.void
clear()
Clear the underlying hibernate session.<T> T
getAttribute
(String key) boolean
isOpen()
void
removeCommitListener
(CommitListener listener) Remove aCommitListener
.void
void
removeEntityListener
(EntityListener listener) void
removeTransactionListener
(TransactionListener listener) Remove aTransactionListener
for the session.void
setAttribute
(String key, Object value) void
setQueryTimeout
(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 aTransactionListener
that will be added to all transactions that will be started in this session. -
removeTransactionListener
Remove aTransactionListener
for the session. -
addCommitListener
Register aCommitListener
for this session. -
removeCommitListener
Remove aCommitListener
.
-