Package de.esoco.entity
Klasse EntityTransaction
java.lang.Object
de.esoco.entity.EntityTransaction
- Alle implementierten Schnittstellen:
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
KonstruktorBeschreibungEntityTransaction
(Entity entity) Creates a new transaction for a particular entity. -
Methodenübersicht
-
Konstruktordetails
-
EntityTransaction
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.StorageExceptionCommits 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 methodTransactionManager.addTransactionElement(Transactional)
. If no such transaction is currently active an exception will occur.- Angegeben von:
commit
in Schnittstellede.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 Schnittstellede.esoco.lib.manage.Transactional
-