org.jpox.store
Class OID

java.lang.Object
  extended byorg.jpox.store.OID
All Implemented Interfaces:
java.io.Serializable

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

An object identifier. OIDs are normally used as object identifiers for persistent objects that use datastore identity. They're also used for view objects, which actually use non-datastore identity. The behaviour of this class is governed by JDO spec 5.4.3.

Version:
$Revision: 1.17 $
See Also:
Serialized Form

Field Summary
 int hashCode
          pre-created hasCode to improve performance
 java.lang.Object oid
          The identity.
 java.lang.String pcClass
          The PersistenceCapable class name
 java.lang.String toString
          pre-created toString to improve performance
 
Constructor Summary
OID()
          Creates an OID with the no value.
OID(java.lang.String str)
          Constructs an OID from its string representation that is consistent with the output of toString().
OID(java.lang.String pcClass, java.lang.Object object)
          Create a string datastore identity
 
Method Summary
 boolean equals(java.lang.Object obj)
          Equality operator.
 java.lang.Object getNewObjectIdCopy()
          Returns copy of the requested oid to be accessed by the user.
 java.lang.String getPcClass()
          Accessor for the PC class name
 int hashCode()
          Accessor for the hashcode
 java.lang.Object keyValue()
          Provides the OID in a form that can be used by the database as a key.
 java.lang.String toString()
          Returns the string representation of the OID.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

oid

public final java.lang.Object oid
The identity.


pcClass

public final java.lang.String pcClass
The PersistenceCapable class name


toString

public final java.lang.String toString
pre-created toString to improve performance


hashCode

public final int hashCode
pre-created hasCode to improve performance

Constructor Detail

OID

public OID()
Creates an OID with the no value. Required by the JDO spec


OID

public OID(java.lang.String pcClass,
           java.lang.Object object)
Create a string datastore identity

Parameters:
pcClass - The PersistenceCapable class that this represents
object - The value

OID

public OID(java.lang.String str)
    throws java.lang.IllegalArgumentException
Constructs an OID from its string representation that is consistent with the output of toString().

Parameters:
str - the string representation of an OID.
Throws:
java.lang.IllegalArgumentException - if the given string representation is not valid.
See Also:
toString
Method Detail

getNewObjectIdCopy

public java.lang.Object getNewObjectIdCopy()
Returns copy of the requested oid to be accessed by the user.

Returns:
Copy of the OID.

keyValue

public java.lang.Object keyValue()
Provides the OID in a form that can be used by the database as a key.

Returns:
The key value

equals

public boolean equals(java.lang.Object obj)
Equality operator.

Parameters:
obj - Object to compare against
Returns:
Whether they are equal

hashCode

public int hashCode()
Accessor for the hashcode

Returns:
Hashcode for this object

toString

public java.lang.String toString()
Returns the string representation of the OID. Will be a string such as "1[OID]org.jpox.samples.MyClass" where

Returns:
the string representation of the OID.

getPcClass

public java.lang.String getPcClass()
Accessor for the PC class name

Returns:
the PC Class


Copyright © -2007 . All Rights Reserved.