Overview | Package | Class | Tree | Deprecated | Index | Help
| Kodo 4.0.0 generated on May 15 2006
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## kodo.jdo
Class KodoJDOHelper

    java.lang.Object
      javax.jdo.JDOHelper
          kodo.jdo.KodoJDOHelper

All Implemented Interfaces:
  kodo.kernel.LockLevels

    public class KodoJDOHelper

extends JDOHelper
implements kodo.kernel.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 kodo.kernel.LockLevels
`LOCK_NONE, LOCK_READ, LOCK_WRITE`

Constructor Summary
`KodoJDOHelper()`

Method Summary
`static KodoDataStoreCache` | `cast(javax.jdo.datastore.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 javax.jdo.datastore.Sequence` | `getFieldSequence(Object o, String fieldName)` Returns a `Sequence` for the generated values of the specified field.
`static javax.jdo.datastore.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 kodo.meta.ClassMetaData` | `getMetaData(Object o)` Returns the `ClassMetaData` associated with the type of the given object.
`static kodo.meta.ClassMetaData` | `getMetaData(PersistenceManager pm, Class cls)` Returns the `ClassMetaData` associated with the persistent type `cls`.
`static kodo.meta.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 kodo.kernel.Broker` | `toBroker(PersistenceManager pm)` Return the underlying broker for the given persistence manager facade.
`static kodo.kernel.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(kodo.kernel.Broker broker)` Return a persistence manager facade to the given broker.
`static KodoPersistenceManagerFactory` | `toPersistenceManagerFactory(kodo.kernel.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(kodo.kernel.BrokerFactory factory)

  Return a persistence manager factory facade to the given broker factory.

### toBrokerFactory

    public static kodo.kernel.BrokerFactory toBrokerFactory(PersistenceManagerFactory pmf)

  Return the underlying broker factory for the given persistence manager factory facade.

### toPersistenceManager

    public static KodoPersistenceManager toPersistenceManager(kodo.kernel.Broker broker)

  Return a persistence manager facade to the given broker.

### toBroker

    public static kodo.kernel.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(javax.jdo.datastore.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 kodo.meta.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 kodo.meta.ClassMetaData getMetaData(PersistenceManager pm,
                                                      Class cls)

  Returns the `ClassMetaData` associated with the persistent type `cls`.

### getMetaData

    public static kodo.meta.ClassMetaData getMetaData(PersistenceManagerFactory pmf,
                                                      Class cls)

  Returns the `ClassMetaData` associated with the persistent type `cls`.

### getIdentitySequence

    public static javax.jdo.datastore.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 javax.jdo.datastore.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.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Kodo 4.0.0 generated on May 15 2006
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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