|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jdo.impl.fostore.OID
Represents the identity of a JDO object in the File/Object store. This implementation uses datastore identity. The identity is based on the class of the object and a unique identifier within that class. These OID's are unique only within a single datastore.
This class is public
as required by the JDO specification.
Field Summary | |
(package private) static long |
CLID_MASK
|
(package private) static int |
CLID_SHIFT
|
private int |
hashCode
|
private static java.lang.Integer |
lock
|
(package private) static org.apache.commons.logging.Log |
logger
Logger |
(package private) static int |
MAX_CLID
|
(package private) static long |
MAX_UID
|
(package private) static I18NHelper |
msg
I18N support. |
private static long |
nextProvisional
|
long |
oid
The 'value' of this OID. |
private java.lang.Class |
pcClass
|
(package private) static long |
PROV_CLID_MASK
|
(package private) static long |
PROV_UID_MASK
|
(package private) static long |
RESERVED_MASK
|
(package private) static int |
RESERVED_SHIFT
|
(package private) static long |
UID_MASK
|
Constructor Summary | |
|
OID()
Creates an OID with the no value. |
private |
OID(CLID clid)
|
|
OID(long oid)
Creates an OID with the given value. |
|
OID(java.lang.String str)
Constructor that takes the result of toString() and creates a new OID. |
Method Summary | |
int |
compareTo(java.lang.Object obj)
Compare this OID to another OID. |
(package private) OID |
copy()
Returns copy of the requested oid. |
(package private) void |
copyKeyFieldsToPC(StateManagerInternal sm,
FOStorePMF pmf,
java.lang.Class pcClass,
int[] pkfields)
Copy key fields from OID into PC instance. |
(package private) static OID |
create(CLID clid)
Create and return a provisional OID |
(package private) static OID |
create(CLID clid,
long uid)
Provides an OID for the given CLID and UID. |
(package private) OID |
create(long oid)
Create and return a based on a given representation. |
boolean |
equals(java.lang.Object other)
Determines if this OID is equal to another. |
CLID |
getCLID()
Provides the CLID part of this OID. |
(package private) java.lang.Object |
getExternalObjectId(javax.jdo.spi.PersistenceCapable pc)
Returns copy of the requested oid to be accessed by the user. |
(package private) java.lang.Class |
getPCClass(FOStorePMF pmf)
Returns Class that defined OID. |
long |
getUID()
Provides the unique id part of this OID. |
int |
hashCode()
Provides a JVM-unique hashCode for this OID. |
(package private) boolean |
isApplicationIdentity()
Returns false for application identity type for this OID. |
(package private) boolean |
isDataStoreIdentity()
Returns true for datastore identity type for this OID. |
boolean |
isProvisional()
Indicates whether this OID is provisional. |
(package private) org.netbeans.mdr.persistence.MOFID |
keyValue(FOStoreBtreeStorage storage)
Provides the OID in a form that can be used by the database as a key. |
java.lang.String |
oidString()
Returns the id itself in String form, for debugging. |
(package private) static OID |
read(java.io.DataInput in)
|
private void |
readObject(java.io.ObjectInputStream in)
Reads this OID's value from the input stream. |
(package private) void |
replaceProvisionalOIDWithReal(OID realOID,
FOStorePMF pmf,
StateManagerInternal sm)
Replaces provisional oid with real oid (datastore identity only) |
(package private) static void |
skip(java.io.DataInput in)
Skip OID bytes from the input. |
java.lang.String |
toString()
Returns a String representation of this OID. |
(package private) void |
write(java.io.DataOutput out)
|
private void |
writeObject(java.io.ObjectOutputStream out)
Writes this OID to the output stream. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
static final long RESERVED_MASK
static final long PROV_UID_MASK
static final long PROV_CLID_MASK
static final long CLID_MASK
static final long UID_MASK
static final int CLID_SHIFT
static final int MAX_CLID
static final long MAX_UID
static final int RESERVED_SHIFT
public long oid
private int hashCode
private static long nextProvisional
private java.lang.Class pcClass
private static final java.lang.Integer lock
static final I18NHelper msg
static final org.apache.commons.logging.Log logger
Constructor Detail |
public OID()
public OID(java.lang.String str)
toString()
public OID(long oid)
private OID(CLID clid)
Method Detail |
static OID create(CLID clid)
OID create(long oid)
javax.jdo.JDOFatalException
- Thrown if given oid has its provisional bit set.static OID create(CLID clid, long uid)
clid
- CLID for the OID.uid
- UID part of the OID.
javax.jdo.JDOFatalException
- Thrown if given CLID is provisional.public boolean isProvisional()
public CLID getCLID()
public long getUID()
public int hashCode()
public boolean equals(java.lang.Object other)
other
- The other OID in the equality comparison.
public java.lang.String toString()
public java.lang.String oidString()
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException
java.io.IOException
void write(java.io.DataOutput out) throws java.io.IOException
java.io.IOException
static OID read(java.io.DataInput in) throws java.io.IOException
java.io.IOException
static void skip(java.io.DataInput in) throws java.io.IOException
in
- DataInput.
IOException.
java.io.IOException
java.lang.Object getExternalObjectId(javax.jdo.spi.PersistenceCapable pc)
org.netbeans.mdr.persistence.MOFID keyValue(FOStoreBtreeStorage storage)
void replaceProvisionalOIDWithReal(OID realOID, FOStorePMF pmf, StateManagerInternal sm)
realOID
- as OID instancepmf
- as FOStorePMFsm
- as StateManagerInternalOID copy()
void copyKeyFieldsToPC(StateManagerInternal sm, FOStorePMF pmf, java.lang.Class pcClass, int[] pkfields)
sm
- as StateManagerInternalpmf
- as FOStorePMFpcClass
- Class of the PC instance.pkfields
- array of PK field numbers.java.lang.Class getPCClass(FOStorePMF pmf)
pmf
- as FOStorePMFboolean isApplicationIdentity()
boolean isDataStoreIdentity()
public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |