org.exolab.castor.persist

Class OID


public final class OID
extends java.lang.Object

Object identifier. An object identifier is unique within a cache engine or other persistence mechanism and is used to locate object based on their identity as well as assure no duplicate identities. The object type and it's identity object define the OID's identity. In addition the OID is used to hold the object's stamp and db-lock access fields which are used to optimize dirty checking within a transaction.
Version:
$Revision: 1.1.1.1 $ $Date: 2003/03/03 07:08:46 $
Author:
Assaf Arkin

Constructor Summary

OID(LockEngine engine, ClassMolder molder, Object identity)
Constructor
OID(LockEngine engine, ClassMolder molder, OID depends, Object identity)
Constructor

Method Summary

boolean
equals(Object obj)
Returns true if the two OID's are identical.
OID
getDepends()
Get the depended object's oid
(package private) Object
getIdentity()
Return the object's identity, if known.
(package private) LockEngine
getLockEngine()
Get the LockEngine of this object
(package private) ClassMolder
getMolder()
Get the ClassMolder of this object
(package private) String
getName()
Return the full qualified name of the object's type.
(package private) Object
getStamp()
Returns the OID's stamp.
(package private) String[]
getSuperClassNames()
Return the full qualified names of the object's superclasses, if any, otherwise returns null.
int
hashCode()
(package private) boolean
isDbLock()
Returns true if the object represented by this OID has a database lock.
(package private) void
setDbLock(boolean dbLock)
Specifies whether the object represented by this OID has a database lock.
(package private) void
setStamp(Object stamp)
Sets the OID's stamp.
String
toString()

Constructor Details

OID

(package private)  OID(LockEngine engine,
                       ClassMolder molder,
                       Object identity)
Constructor

OID

(package private)  OID(LockEngine engine,
                       ClassMolder molder,
                       OID depends,
                       Object identity)
Constructor

Method Details

equals

public boolean equals(Object obj)
Returns true if the two OID's are identical. Two OID's are identical only if they represent the same object type and have the same identity (based on equality test). If no identity was specified for either or both objects, the objects are not identical.

getDepends

public OID getDepends()
Get the depended object's oid
Returns:
the depended object's oid

getIdentity

(package private)  Object getIdentity()
Return the object's identity, if known. And identity exists for every object that was loaded within a transaction and for those objects that were created with an identity. No two objects may have the same identity in persistent storage. If the object was created without an identity this method will return null until the object is first stored and it's identity is set.
Returns:
The object's identity, or null

getLockEngine

(package private)  LockEngine getLockEngine()
Get the LockEngine of this object
Returns:
the LockEngine of this object.

getMolder

(package private)  ClassMolder getMolder()
Get the ClassMolder of this object
Returns:
the ClassMolder of this object

getName

(package private)  String getName()
Return the full qualified name of the object's type. When using inheritance this is the type's full name of the top most object in the inheritance heirarchy specified in the object mapping.
Returns:
The object's type's full name

getStamp

(package private)  Object getStamp()
Returns the OID's stamp. The stamp may be used to efficiently implement dirty checking. The stamp is set with a call to setStamp(Object) when the object is loaded, created or stored in persistent storage. Not all persistence engines support the stamp mechanism.
Returns:
The OID's stamp, or null

getSuperClassNames

(package private)  String[] getSuperClassNames()
Return the full qualified names of the object's superclasses, if any, otherwise returns null.
Returns:
The object's type's superclasses full name

hashCode

public int hashCode()

isDbLock

(package private)  boolean isDbLock()
Returns true if the object represented by this OID has a database lock. Database locks overrides the need to perform dirty checking on the object. This status is set when the object is loaded with db-lock access, created or deleted. It is reset when the object is unlocked.
Returns:
True the object represented by this OID is loaded with a datbase lock

setDbLock

(package private)  void setDbLock(boolean dbLock)
Specifies whether the object represented by this OID has a database lock. Database locks overrides the need to perform dirty checking on the object. This status is set when the object is loaded with db-lock access, created or deleted. It is reset when the object is unlocked.
Parameters:
dbLock - True the object represented by this OID has a database lock

setStamp

(package private)  void setStamp(Object stamp)
Sets the OID's stamp. The stamp may be used to efficiently implement dirty checking. Not all persistence engines support the stamp mechanism.
Parameters:
stamp - The OID's stamp

toString

public String toString()

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