Class Transaction

java.lang.Object
com.aquima.interactions.foundation.tx.Transaction
All Implemented Interfaces:
ITransaction, ITransactionalAction, Serializable

public class Transaction extends Object implements ITransaction
This class represents a single transaction.
Since:
6.5
Author:
O. Kerpershoek
See Also:
  • Constructor Details

    • Transaction

      protected Transaction(GUID id, String name, boolean mergeOnCommit)
      Constructs the transaction object with an optional name.
      Parameters:
      id - Unique ID for the transaction (required).
      name - The name of the transaction (optional).
      mergeOnCommit - whether to merge on commit
  • Method Details

    • isSystem

      public boolean isSystem()
    • getId

      public GUID getId()
      Description copied from interface: ITransaction
      This method returns the unique ID of the transaction (never null).
      Specified by:
      getId in interface ITransaction
      Returns:
      The unique ID of the transaction.
    • getName

      public String getName()
      Description copied from interface: ITransaction
      This method returns the name of the transaction, or null is none was defined.
      Specified by:
      getName in interface ITransaction
      Returns:
      the name of the transaction, or null is none was defined.
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: ITransaction
      This method returns a boolean indicating if this transaction stack does not contain any (sub)transactions.
      Specified by:
      isEmpty in interface ITransaction
      Returns:
      a boolean indicating if this transaction stack does not contain any (sub)transactions.
    • size

      public int size()
      Description copied from interface: ITransaction
      This method returns the number of actions that are present in this transaction.
      Specified by:
      size in interface ITransaction
      Returns:
      the number of actions that are present in this transaction.
    • add

      public void add(ITransactionalAction transaction)
      Description copied from interface: ITransaction
      This method will add the transaction to the stack.
      Specified by:
      add in interface ITransaction
      Parameters:
      transaction - The transaction that should be added.
    • rollback

      public void rollback(IRollbackContext context)
      Description copied from interface: ITransactionalAction
      Performs a roll-back on the current (sub)transaction.
      Specified by:
      rollback in interface ITransactionalAction
      Parameters:
      context - the rollback context
    • duplicate

      public ITransactionalAction duplicate()
      Description copied from interface: ITransactionalAction
      Returns a deep copy of the transaction.
      Specified by:
      duplicate in interface ITransactionalAction
      Returns:
      The copied action.
    • getTransactables

      public ITransactionalAction[] getTransactables()