org.exolab.castor.persist
Class TransactionContext.ObjectEntry

java.lang.Object
  extended byorg.exolab.castor.persist.TransactionContext.ObjectEntry
Enclosing class:
TransactionContext

public static final class TransactionContext.ObjectEntry
extends java.lang.Object

A transaction records all objects accessed during the lifetime of the transaction in this record (queries and created). A single entry exist for each object accessible using the object or it's OID as identities. The entry records the database engine used to persist the object, the object's OID, the object itself, and whether the object has been deleted in this transaction, created in this transaction, or modified. Objects identified as read only are not update when the transaction commits.


Field Summary
(package private)  boolean created
          True if the object has been created in this transaction.
(package private)  boolean creating
          True if the object is indicated to be created.
(package private)  boolean deleted
          True if the object has been marked for deletion.
(package private)  LockEngine engine
          The engine with which the object was loaded/created.
(package private)  ClassMolder molder
          ClassMolder which the object was loaded/created.
(package private)  TransactionContext.ObjectEntry nextDeleted
          Link to the next deleted object in a FIFO list of deleted objects.
(package private)  java.lang.Object object
          The object.
(package private)  OID oid
          The OID of the object.
(package private)  boolean updateCacheNeeded
          True if the object has been modified and the cache should be updated at commit time
(package private)  boolean updatePersistNeeded
          True if the object has been modified and the persistence storage should be updated
 
Constructor Summary
(package private) TransactionContext.ObjectEntry(LockEngine engine, ClassMolder molder, OID oid, java.lang.Object object)
           
 
Method Summary
 java.lang.Object getObject()
          Allow TxSynchronizable to access the object.
 OID getOid()
          Allow TxSynchronizable to access OID of the object.
 boolean isCreated()
          Allow TxSynchronizable to access created flag.
 boolean isDeleted()
          Allow TxSynchronizable to access deleted flag.
 boolean isUpdateCacheNeeded()
          Allow TxSynchronizable to access flag showing if the object has been modified and the cache has been updated.
 boolean isUpdatePersistNeeded()
          Allow TxSynchronizable to access flag showing if the object has been modified and the persistence storage has been updated.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

engine

final LockEngine engine
The engine with which the object was loaded/created.


molder

final ClassMolder molder
ClassMolder which the object was loaded/created. It maybe different from engine.getClassMolder(). RelationCollection generally share the same java class, but representing relations of different pair of object.


object

final java.lang.Object object
The object.


oid

OID oid
The OID of the object.


deleted

boolean deleted
True if the object has been marked for deletion.


created

boolean created
True if the object has been created in this transaction.


creating

boolean creating
True if the object is indicated to be created.


updateCacheNeeded

boolean updateCacheNeeded
True if the object has been modified and the cache should be updated at commit time


updatePersistNeeded

boolean updatePersistNeeded
True if the object has been modified and the persistence storage should be updated


nextDeleted

TransactionContext.ObjectEntry nextDeleted
Link to the next deleted object in a FIFO list of deleted objects.

Constructor Detail

TransactionContext.ObjectEntry

TransactionContext.ObjectEntry(LockEngine engine,
                               ClassMolder molder,
                               OID oid,
                               java.lang.Object object)
Method Detail

isDeleted

public boolean isDeleted()
Allow TxSynchronizable to access deleted flag.

Returns:
True if the object has been deleted in this transaction.

isCreated

public boolean isCreated()
Allow TxSynchronizable to access created flag.

Returns:
True if the object has been created in this transaction.

isUpdateCacheNeeded

public boolean isUpdateCacheNeeded()
Allow TxSynchronizable to access flag showing if the object has been modified and the cache has been updated.

Returns:
True if the object has been modified and the cache has been updated at commit time.

isUpdatePersistNeeded

public boolean isUpdatePersistNeeded()
Allow TxSynchronizable to access flag showing if the object has been modified and the persistence storage has been updated.

Returns:
True if the object has been modified and the persistence storage has been updated.

getOid

public OID getOid()
Allow TxSynchronizable to access OID of the object.

Returns:
The OID of the object.

getObject

public java.lang.Object getObject()
Allow TxSynchronizable to access the object.

Returns:
The object.

toString

public java.lang.String toString()


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com