SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

com.solarmetric.kodo.util
Class ObjectIds

java.lang.Object
  |
  +--com.solarmetric.kodo.util.ObjectIds

public class ObjectIds
extends Object

Utility class for manipulating JDO object IDs.


Inner Class Summary
static class ObjectIds.Id
          Type for generated data store identity classes.
 
Constructor Summary
ObjectIds()
           
 
Method Summary
static Object copy(ClassMetaData meta, Object oid)
          Copy the given oid value.
static Object fromPKValues(ClassMetaData meta, Object[] pks)
          Return a new object id constructed from the given primary key values.
static ClassMetaData getMetaData(Object oid, ClassResolver loader)
          Return the least-derived concrete registered persistent class for the given oid.
static Object objectIdFromString(String idstr, ClassResolver loader)
           
static String objectIdToString(Object id)
          Wrap the specified object ID class in a String that will contain the owning class.
static void register(ClassMetaData meta)
          Register a persistent type.
static Object[] toPKValues(ClassMetaData meta, Object oid)
          Return the primary key values for the given object id.
static Object validateId(Object id, Object compare)
          Validate that the hashCode and equals method of an Object ID class fulfill the requirements of the JDO specification.
static void validateObjectId(ClassMetaData meta, Object id)
          Validate the specified id class if it the first time we have seen it.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectIds

public ObjectIds()
Method Detail

register

public static void register(ClassMetaData meta)
Register a persistent type.

getMetaData

public static ClassMetaData getMetaData(Object oid,
                                        ClassResolver loader)
Return the least-derived concrete registered persistent class for the given oid.

copy

public static Object copy(ClassMetaData meta,
                          Object oid)
Copy the given oid value.

validateObjectId

public static void validateObjectId(ClassMetaData meta,
                                    Object id)
Validate the specified id class if it the first time we have seen it.
Throws:
JDOFatalUserException - if the specified object ID class does not correctly override the hashCode() and equals() methods.

validateId

public static Object validateId(Object id,
                                Object compare)
Validate that the hashCode and equals method of an Object ID class fulfill the requirements of the JDO specification.
Returns:
the id argument
Throws:
JDOFatalUserException - if the specified object ID class does not correctly override the hashCode() and equals() methods.

objectIdToString

public static String objectIdToString(Object id)
Wrap the specified object ID class in a String that will contain the owning class.

The serialized object ID will be of the form: <classname>:id.toString()

Throws:
UserException - if the class of the application id cannot be loaded.

objectIdFromString

public static Object objectIdFromString(String idstr,
                                        ClassResolver loader)

toPKValues

public static Object[] toPKValues(ClassMetaData meta,
                                  Object oid)
Return the primary key values for the given object id.

fromPKValues

public static Object fromPKValues(ClassMetaData meta,
                                  Object[] pks)
Return a new object id constructed from the given primary key values.

SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.