Klasse EntityTransaction

java.lang.Object
de.esoco.entity.EntityTransaction
Alle implementierten Schnittstellen:
de.esoco.lib.manage.Transactional

public class EntityTransaction extends Object implements de.esoco.lib.manage.Transactional
A transaction implementation that stores an entity instance on a call to the commit() method. The entity will then be stored in the storage that is associated with it's entity definition by performing a lookup with the method StorageManager.getStorage(Object).

Instances of this class are intended to be used only inside transactions. They must be added to a thread's current transaction by means of the method TransactionManager.addTransactionElement(Transactional). If invoked outside a transaction an exception will occur.

  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    Creates a new transaction for a particular entity.
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    void
    Commits the entity by storing it in the storage that is associated with it's entity definition in the current thread.
    void
    This method simply sets the entity reference to NULL.

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Konstruktordetails

    • EntityTransaction

      public EntityTransaction(Entity entity)
      Creates a new transaction for a particular entity.
      Parameter:
      entity - The entity to wrap into the transaction
  • Methodendetails

    • commit

      public void commit() throws de.esoco.storage.StorageException
      Commits the entity by storing it in the storage that is associated with it's entity definition in the current thread. The storage will be added to an active transaction of the current thread's by invoking the method TransactionManager.addTransactionElement(Transactional). If no such transaction is currently active an exception will occur.
      Angegeben von:
      commit in Schnittstelle de.esoco.lib.manage.Transactional
      Löst aus:
      de.esoco.storage.StorageException
    • rollback

      public void rollback()
      This method simply sets the entity reference to NULL.
      Angegeben von:
      rollback in Schnittstelle de.esoco.lib.manage.Transactional