org.apache.openjpa.util
Class ApplicationIds

java.lang.Object
  extended by org.apache.openjpa.util.ApplicationIds

public class ApplicationIds
extends java.lang.Object

Utility class for manipulating application object ids.

Author:
Abe White

Constructor Summary
ApplicationIds()
           
 
Method Summary
static boolean assign(OpenJPAStateManager sm, StoreManager store, boolean preFlush)
          Assign an application identity object to the given state, or return false if determining the application identity requires a flush.
static java.lang.Object copy(java.lang.Object oid, ClassMetaData meta)
          Copy the given oid value.
static java.lang.Object create(PersistenceCapable pc, ClassMetaData meta)
          Generate an application id based on the current primary key field state of the given instance.
static java.lang.Object fromPKValues(java.lang.Object[] pks, ClassMetaData meta)
          Return a new object id constructed from the given primary key values.
static java.lang.Object[] toPKValues(java.lang.Object oid, ClassMetaData meta)
          Return the primary key values for the given object id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationIds

public ApplicationIds()
Method Detail

toPKValues

public static java.lang.Object[] toPKValues(java.lang.Object oid,
                                            ClassMetaData meta)
Return the primary key values for the given object id. The values will be returned in the same order as the metadata primary key fields.


fromPKValues

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


copy

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


create

public static java.lang.Object create(PersistenceCapable pc,
                                      ClassMetaData meta)
Generate an application id based on the current primary key field state of the given instance.


assign

public static boolean assign(OpenJPAStateManager sm,
                             StoreManager store,
                             boolean preFlush)
Assign an application identity object to the given state, or return false if determining the application identity requires a flush.



Copyright © 2006 Apache Software Foundation. All Rights Reserved.