com.orientechnologies.jdo
Class oOID

java.lang.Object
  extended bycom.orientechnologies.jdo.oOID
All Implemented Interfaces:
java.io.Serializable

public class oOID
extends java.lang.Object
implements java.io.Serializable

Indicates a persistent object in the datastore. Each object has own oid associated.

See Also:
Serialized Form

Field Summary
static java.lang.Class CLASS
           
static byte NO_REF_POOL
           
static byte OWN_DB
           
 
Constructor Summary
oOID()
          Create an empty oOID object.
oOID(byte iRefPool, byte iDatabase, short iClass, int iRecord)
          Create an oOID object with values given by datastore.
oOID(int iRefPool, int iDatabase, int iClass, int iRecord)
          Create an oOID object with values.
oOID(java.lang.String iValue)
          Create an oOID object from a string.
 
Method Summary
 boolean equals(java.lang.Object iObject)
          Compare two oOID objects.
 short getClazz()
          Get class id
 byte getDatabase()
          Get database id
 int getRecord()
          Get the record id inside a segment
 byte getRefPool()
          Get current datastore id
 int hashCode()
          Return the hash code for sorting in Map collections
 boolean isValid()
          Know if the OID is valid.
 void reset()
          Reset the oid.
 void set(byte iRefPool, byte iDatabase, short iClass, int iRecord)
          Update oOID values after creation
 java.lang.String toString()
          Convert an OID to a String.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

OWN_DB

public static byte OWN_DB

NO_REF_POOL

public static byte NO_REF_POOL

CLASS

public static java.lang.Class CLASS
Constructor Detail

oOID

public oOID()
Create an empty oOID object.


oOID

public oOID(byte iRefPool,
            byte iDatabase,
            short iClass,
            int iRecord)
Create an oOID object with values given by datastore.


oOID

public oOID(int iRefPool,
            int iDatabase,
            int iClass,
            int iRecord)
Create an oOID object with values.


oOID

public oOID(java.lang.String iValue)
Create an oOID object from a string.

Method Detail

hashCode

public int hashCode()
Return the hash code for sorting in Map collections

Returns:
near-unique hash code

equals

public boolean equals(java.lang.Object iObject)
Compare two oOID objects.

Parameters:
iObject - Object to compare
Returns:
TRUE if the object contain the same values, otherwise FALSE.

reset

public void reset()
Reset the oid. After reset the OID is invalid.

See Also:
isValid()

set

public void set(byte iRefPool,
                byte iDatabase,
                short iClass,
                int iRecord)
Update oOID values after creation

Parameters:
iRefPool - datastore id
iDatabase - database id
iClass - class id
iRecord - record id

getRefPool

public byte getRefPool()
Get current datastore id

Returns:
datastore id (byte)

getDatabase

public byte getDatabase()
Get database id

Returns:
database id (byte)

getClazz

public short getClazz()
Get class id

Returns:
class id inside the database (short)

getRecord

public int getRecord()
Get the record id inside a segment

Returns:
record id (int)

isValid

public boolean isValid()
Know if the OID is valid. A valid OID can also point to a removed or not existent object.

Returns:
TRUE if is valid, otherwise FALSE

toString

public java.lang.String toString()
Convert an OID to a String. The oOID instance can be re-created with the by the constructor that accepts the String as parameter or by the PersistenceManager.getObjectId()

Returns:
See Also:
oOID( String iValue ), PersistenceManager.getObjectId(Object iObject)