Kodo 4.2.0. generated on July 28 2008

kodo.jdo
Class KodoJDOHelper

java.lang.Object
  extended by javax.jdo.JDOHelper
      extended by kodo.jdo.KodoJDOHelper
All Implemented Interfaces:
LockLevels

public class KodoJDOHelper
extends JDOHelper
implements LockLevels

Static helper methods for JDO users, including switching between Kodo native and JDO APIs.

Since:
4.0

Field Summary
static String PM_KEY
           
static String PMF_KEY
           
 
Fields inherited from interface org.apache.openjpa.kernel.LockLevels
LOCK_NONE, LOCK_READ, LOCK_WRITE
 
Constructor Summary
KodoJDOHelper()
           
 
Method Summary
static KodoDataStoreCache cast(DataStoreCache cache)
          Return the Kodo facade to the given cache.
static KodoExtent cast(Extent e)
          Return the Kodo facade to the given extent.
static KodoFetchPlan cast(FetchPlan fetch)
          Return the Kodo facade to the given fetch plan.
static KodoPersistenceManager cast(PersistenceManager pm)
          Return the Kodo facade to the given entity manager.
static KodoPersistenceManagerFactory cast(PersistenceManagerFactory pmf)
          Return the Kodo facade to the given persistence manager factory.
static KodoQuery cast(Query q)
          Return the Kodo facade to the given query.
static void close(Object o)
          Close the given resource.
static Object fromKodoObjectId(Object oid)
          Translate from a Kodo identity object to a JDO one.
static Class fromKodoObjectIdClass(Class cls)
          Translate from a Kodo identity class to a JDO one.
static Object getDetachedState(Object o)
          Return the detached state of the specified object, or null if none.
static Sequence getFieldSequence(Object o, String fieldName)
          Returns a Sequence for the generated values of the specified field.
static Sequence getIdentitySequence(Object o)
          Returns a Sequence for the datastore identity values of the specified instance, or null if the object is unmanaged or its identity cannot be represented by a sequence.
static int getLockLevel(Object o)
          Return the lock level of the specified object.
static ClassMetaData getMetaData(Object o)
          Returns the ClassMetaData associated with the type of the given object.
static ClassMetaData getMetaData(PersistenceManager pm, Class cls)
          Returns the ClassMetaData associated with the persistent type cls.
static ClassMetaData getMetaData(PersistenceManagerFactory pmf, Class cls)
          Returns the ClassMetaData associated with the persistent type cls.
static KodoPersistenceManagerFactory getPersistenceManagerFactory()
          Returns a PersistenceManagerFactory configured based on your system defaults.
static void setDetachedState(Object o, Object state)
          Set the detached state of the specified object.
static Broker toBroker(PersistenceManager pm)
          Return the underlying broker for the given persistence manager facade.
static BrokerFactory toBrokerFactory(PersistenceManagerFactory pmf)
          Return the underlying broker factory for the given persistence manager factory facade.
static Object toKodoObjectId(Object oid, PersistenceManager pm)
          Translate from a JDO identity object to a Kodo one.
static Collection toKodoObjectIds(Collection oids, PersistenceManager pm)
          Return a collection of Kodo oids for the given native oid collection.
static Object[] toKodoObjectIds(Object[] oids, PersistenceManager pm)
          Return an array of Kodo oids for the given native oid array.
static KodoPersistenceManager toPersistenceManager(Broker broker)
          Return a persistence manager facade to the given broker.
static KodoPersistenceManagerFactory toPersistenceManagerFactory(BrokerFactory factory)
          Return a persistence manager factory facade to the given broker factory.
 
Methods inherited from class javax.jdo.JDOHelper
getObjectId, getObjectIds, getObjectIds, getPersistenceManager, getPersistenceManagerFactory, getPersistenceManagerFactory, getPersistenceManagerFactory, getPersistenceManagerFactory, getPersistenceManagerFactory, getPersistenceManagerFactory, getPersistenceManagerFactory, getPersistenceManagerFactory, getPersistenceManagerFactory, getPersistenceManagerFactory, getPersistenceManagerFactory, getTransactionalObjectId, getVersion, isDeleted, isDetached, isDirty, isNew, isPersistent, isTransactional, makeDirty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PMF_KEY

public static final String PMF_KEY
See Also:
Constant Field Values

PM_KEY

public static final String PM_KEY
See Also:
Constant Field Values
Constructor Detail

KodoJDOHelper

public KodoJDOHelper()
Method Detail

toPersistenceManagerFactory

public static KodoPersistenceManagerFactory toPersistenceManagerFactory(BrokerFactory factory)
Return a persistence manager factory facade to the given broker factory.


toBrokerFactory

public static BrokerFactory toBrokerFactory(PersistenceManagerFactory pmf)
Return the underlying broker factory for the given persistence manager factory facade.


toPersistenceManager

public static KodoPersistenceManager toPersistenceManager(Broker broker)
Return a persistence manager facade to the given broker.


toBroker

public static Broker toBroker(PersistenceManager pm)
Return the underlying broker for the given persistence manager facade.


cast

public static KodoPersistenceManagerFactory cast(PersistenceManagerFactory pmf)
Return the Kodo facade to the given persistence manager factory.


cast

public static KodoPersistenceManager cast(PersistenceManager pm)
Return the Kodo facade to the given entity manager.


cast

public static KodoQuery cast(Query q)
Return the Kodo facade to the given query.


cast

public static KodoExtent cast(Extent e)
Return the Kodo facade to the given extent.


cast

public static KodoFetchPlan cast(FetchPlan fetch)
Return the Kodo facade to the given fetch plan.


cast

public static KodoDataStoreCache cast(DataStoreCache cache)
Return the Kodo facade to the given cache.


getPersistenceManagerFactory

public static KodoPersistenceManagerFactory getPersistenceManagerFactory()
Returns a PersistenceManagerFactory configured based on your system defaults.


getMetaData

public static ClassMetaData getMetaData(Object o)
Returns the ClassMetaData associated with the type of the given object. Returns null if o is null, or is not managed.


getMetaData

public static ClassMetaData getMetaData(PersistenceManager pm,
                                        Class cls)
Returns the ClassMetaData associated with the persistent type cls.


getMetaData

public static ClassMetaData getMetaData(PersistenceManagerFactory pmf,
                                        Class cls)
Returns the ClassMetaData associated with the persistent type cls.


getIdentitySequence

public static Sequence getIdentitySequence(Object o)
Returns a Sequence for the datastore identity values of the specified instance, or null if the object is unmanaged or its identity cannot be represented by a sequence.


getFieldSequence

public static Sequence getFieldSequence(Object o,
                                        String fieldName)
Returns a Sequence for the generated values of the specified field. The instance must be managed.


getDetachedState

public static Object getDetachedState(Object o)
Return the detached state of the specified object, or null if none.


setDetachedState

public static void setDetachedState(Object o,
                                    Object state)
Set the detached state of the specified object.


getLockLevel

public static int getLockLevel(Object o)
Return the lock level of the specified object.


close

public static void close(Object o)
Close the given resource. The resource can be an extent iterator, query result, large result set relation, or any closeable Kodo component.


fromKodoObjectId

public static Object fromKodoObjectId(Object oid)
Translate from a Kodo identity object to a JDO one.


toKodoObjectId

public static Object toKodoObjectId(Object oid,
                                    PersistenceManager pm)
Translate from a JDO identity object to a Kodo one.


toKodoObjectIds

public static Object[] toKodoObjectIds(Object[] oids,
                                       PersistenceManager pm)
Return an array of Kodo oids for the given native oid array.


toKodoObjectIds

public static Collection toKodoObjectIds(Collection oids,
                                         PersistenceManager pm)
Return a collection of Kodo oids for the given native oid collection.


fromKodoObjectIdClass

public static Class fromKodoObjectIdClass(Class cls)
Translate from a Kodo identity class to a JDO one.


Kodo 4.2.0. generated on July 28 2008

Copyright 2001-2006 BEA Systems, Inc. All Rights Reserved.