Class ThrowableTransaction<R>

java.lang.Object
com.jalios.jcms.db.ThrowableTransaction<R>
All Implemented Interfaces:
Transaction<R>
Direct Known Subclasses:
LoggableThrowableTransaction

public abstract class ThrowableTransaction<R> extends Object implements Transaction<R>
  • Field Details

  • Constructor Details

    • ThrowableTransaction

      public ThrowableTransaction()
  • Method Details

    • getException

      public Throwable getException()
    • hasFailed

      public boolean hasFailed()
    • execute

      public R execute(org.hibernate.Session session)
      Description copied from interface: Transaction
      Gets called by HibernateUtil.executeTransaction(Transaction) with an active Hibernate Session. Does not need to care about activating or closing the Session, or handling transactions.

      Allows for returning a result object created within this method, i.e. a domain object or a collection of domain objects. A TransactionException can be thrown when there is any Exception: It gets propagated to the caller of the HibernateUtil.executeTransaction(Transaction).

      Specified by:
      execute in interface Transaction<R>
      Parameters:
      session - session passed by the HibernateUtil.executeTransaction(Transaction)
      Returns:
      a result object returned by the action, or null
    • executeTransaction

      public abstract R executeTransaction(org.hibernate.Session session) throws Throwable
      Throws:
      Throwable