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 Details

    • isOpen

      boolean isOpen()
      Returns:
      true is the ssesion is open and usable
    • addCleanupAction

      void addCleanupAction(Runnable runnable)
      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

      Optional<Integer> getQueryTimeout()
    • setAttribute

      void setAttribute(String key, Object value)
    • getAttribute

      <T> T getAttribute(String key)
    • addEntityFacadeListener

      void addEntityFacadeListener(EntityFacadeListener listener)
    • removeEntityFacadeListener

      void removeEntityFacadeListener(EntityFacadeListener listener)
    • addEntityListener

      void addEntityListener(EntityListener listener)
    • removeEntityListener

      void removeEntityListener(EntityListener listener)
    • addTransactionListener

      void addTransactionListener(TransactionListener listener)
      Add a TransactionListener that will be added to all transactions that will be started in this session.
    • removeTransactionListener

      void removeTransactionListener(TransactionListener listener)
      Remove a TransactionListener for the session.
    • addCommitListener

      void addCommitListener(CommitListener listener)
      Register a CommitListener for this session.
    • removeCommitListener

      void removeCommitListener(CommitListener listener)
      Remove a CommitListener.