Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.8 generated on January 11 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.solarmetric.kodo.runtime.objectprovider
Class CustomResultObjectProviderImpl

    java.lang.Object
      |
      +--com.solarmetric.kodo.runtime.objectprovider.CustomResultObjectProviderImpl

All Implemented Interfaces:
  CustomResultObjectProvider

Direct Known Subclasses:
  CustomResultSetResultObjectProvider

public abstract class CustomResultObjectProviderImpl
extends Object
implements CustomResultObjectProvider

Abstract implementation of `CustomResultObjectProvider` that implements `CustomResultObjectProvider.getROPInfo(java.lang.Object, java.lang.Object, com.solarmetric.kodo.meta.ClassMetaData)` by assembling the necessary information about the object to be loaded.

Concrete extensions of this class should implement `CustomResultObjectProvider.getType(java.lang.Object)`, `getDatastoreId(java.lang.Object, com.solarmetric.kodo.meta.ClassMetaData)`, `getOptimisticLockVersion(java.lang.Object, com.solarmetric.kodo.meta.ClassMetaData)`, `getFieldValues(java.lang.Object, com.solarmetric.kodo.meta.ClassMetaData, boolean)`, `CustomResultObjectProvider.open(java.lang.Object)`, `CustomResultObjectProvider.advance(java.lang.Object)`, and `CustomResultObjectProvider.free(java.lang.Object)`.

Inner classes inherited from class com.solarmetric.kodo.runtime.objectprovider.CustomResultObjectProvider
`CustomResultObjectProvider.ResultObjectProviderAdapter, CustomResultObjectProvider.ROPInfo`

Field Summary
`protected PersistenceManagerImpl` | `pm` The @{link PersistenceManagerImpl} that this result object provider will load objects into.

Constructor Summary
`CustomResultObjectProviderImpl(PersistenceManagerImpl pm)` Create a new CustomResultObjectProviderImpl for loading objects of into `pm`.

Method Summary
`protected abstract long` | `getDatastoreId(Object input, ClassMetaData meta)` Return the long object ID for the data in the current data of `input`.
`protected abstract Map` | `getFieldValues(Object input, ClassMetaData meta, boolean pkOnly)` Load the current data in `input` into a `Map` of `FieldMetaData` objects to `Object` values that should be stored in the loaded object.
`Object` | `getObjectId(Object input, ClassMetaData meta)` Determine the id of the current data in `input`.
`protected abstract Object` | `getOptimisticLockVersion(Object input, ClassMetaData meta)` Return the optimistic lock version object for the data in the current data of `input`.
`PersistenceManagerImpl` | `getPersistenceManager()` Return the `PersistenceManagerImpl` that objects loaded by this provider should be loaded into.
`CustomResultObjectProvider.ROPInfo` | `getROPInfo(Object input, Object oid, ClassMetaData meta)` Default implementation invokes `getFieldValues(java.lang.Object, com.solarmetric.kodo.meta.ClassMetaData, boolean)` to obtain the values of all persistent fields to set in the object, and then stores this information in a `PCData`.
`void` | `initialize(StateManagerImpl sm, Set fields, JDOState state, CustomResultObjectProvider.ROPInfo info)` Casts `info.data` to a @{link PCData} and delegates the loading of fields to it.
`void` | `load(StateManagerImpl sm, Set fields, boolean setVersion, CustomResultObjectProvider.ROPInfo info)` Casts `info.data` to a @{link PCData} and delegates the loading of fields to it.

Methods inherited from class java.lang.Object
`, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface com.solarmetric.kodo.runtime.objectprovider.CustomResultObjectProvider
`advance, free, getType, open`

Field Detail

### pm

    protected final PersistenceManagerImpl pm

  The @{link PersistenceManagerImpl} that this result object provider will load objects into.

Constructor Detail

### CustomResultObjectProviderImpl

    public CustomResultObjectProviderImpl(PersistenceManagerImpl pm)

  Create a new CustomResultObjectProviderImpl for loading objects of into `pm`.

Method Detail

### initialize

    public void initialize(StateManagerImpl sm,
                           Set fields,
                           JDOState state,
                           CustomResultObjectProvider.ROPInfo info)

  Casts `info.data` to a @{link PCData} and delegates the loading of fields to it. Implementations that override `getROPInfo(java.lang.Object, java.lang.Object, com.solarmetric.kodo.meta.ClassMetaData)` should override this method and `load(com.solarmetric.kodo.runtime.StateManagerImpl, java.util.Set, boolean, com.solarmetric.kodo.runtime.objectprovider.CustomResultObjectProvider.ROPInfo)`.

  Specified by:
    `initialize` in interface `CustomResultObjectProvider`

### load

    public void load(StateManagerImpl sm,
                     Set fields,
                     boolean setVersion,
                     CustomResultObjectProvider.ROPInfo info)

  Casts `info.data` to a @{link PCData} and delegates the loading of fields to it. Implementations that override `getROPInfo(java.lang.Object, java.lang.Object, com.solarmetric.kodo.meta.ClassMetaData)` should override this method and `initialize(com.solarmetric.kodo.runtime.StateManagerImpl, java.util.Set, com.solarmetric.kodo.runtime.JDOState, com.solarmetric.kodo.runtime.objectprovider.CustomResultObjectProvider.ROPInfo)`.

  Specified by:
    `load` in interface `CustomResultObjectProvider`

### getObjectId

    public Object getObjectId(Object input,
                              ClassMetaData meta)
                       throws Exception

  Description copied from interface: `CustomResultObjectProvider`

  Determine the id of the current data in `input`.

  Specified by:
    `getObjectId` in interface `CustomResultObjectProvider`

### getPersistenceManager

    public PersistenceManagerImpl getPersistenceManager()

  Description copied from interface: `CustomResultObjectProvider`
  Return the `PersistenceManagerImpl` that objects loaded by this provider should be loaded into.
  Specified by:
    `getPersistenceManager` in interface `CustomResultObjectProvider`

### getROPInfo

    public CustomResultObjectProvider.ROPInfo getROPInfo(Object input,
                                                         Object oid,
                                                         ClassMetaData meta)
                                                  throws Exception

  Default implementation invokes `getFieldValues(java.lang.Object, com.solarmetric.kodo.meta.ClassMetaData, boolean)` to obtain the values of all persistent fields to set in the object, and then stores this information in a `PCData`. Implementations that override this method should also override `initialize(com.solarmetric.kodo.runtime.StateManagerImpl, java.util.Set, com.solarmetric.kodo.runtime.JDOState, com.solarmetric.kodo.runtime.objectprovider.CustomResultObjectProvider.ROPInfo)` and `load(com.solarmetric.kodo.runtime.StateManagerImpl, java.util.Set, boolean, com.solarmetric.kodo.runtime.objectprovider.CustomResultObjectProvider.ROPInfo)`.

  Specified by:
    `getROPInfo` in interface `CustomResultObjectProvider`

### getDatastoreId

    protected abstract long getDatastoreId(Object input,
                                           ClassMetaData meta)
                                    throws Exception

  Return the long object ID for the data in the current data of `input`. This will only be invoked if `meta` uses datastore identity. So, if your implementation of this class always loads data governed by datastore identity, then it is safe to use an empty implementation of this method (one that just returns '0', say).

### getOptimisticLockVersion

    protected abstract Object getOptimisticLockVersion(Object input,
                                                       ClassMetaData meta)
                                                throws Exception

  Return the optimistic lock version object for the data in the current data of `input`. This can return `null` if no version information is available.

### getFieldValues

    protected abstract Map getFieldValues(Object input,
                                          ClassMetaData meta,
                                          boolean pkOnly)
                                   throws Exception

  Load the current data in `input` into a `Map` of `FieldMetaData` objects to `Object` values that should be stored in the loaded object.

  If `pkOnly` is `true`, then this method only needs to return the fields that are part of the primary key, as defined by `FieldMetaData.isPrimaryKey()`. Otherwise, all fields available should be returned, including primary key fields.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.8 generated on January 11 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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