|
SolarMetric Kodo JDO 2.4.3 generated on March 27 2003 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.solarmetric.kodo.runtime.objectprovider.CustomResultObjectProviderImpl
Abstract implementation of CustomResultObjectProvider
that implements CustomResultObjectProvider#getResultObject
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. |
com.solarmetric.kodo.runtime.objectprovider.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,
com.solarmetric.kodo.runtime.JDOState state,
com.solarmetric.kodo.runtime.objectprovider.ROPInfo info)
Casts info.data to a @{link PCData} and
delegates the loading of fields to it. |
void |
load(StateManagerImpl sm,
BitSet fields,
boolean setVersion,
com.solarmetric.kodo.runtime.objectprovider.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, initialize, load, open |
| Field Detail |
protected final PersistenceManagerImpl pm
| Constructor Detail |
public CustomResultObjectProviderImpl(PersistenceManagerImpl pm)
pm.| Method Detail |
public void initialize(StateManagerImpl sm,
com.solarmetric.kodo.runtime.JDOState state,
com.solarmetric.kodo.runtime.objectprovider.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.BitSet, boolean, com.solarmetric.kodo.runtime.objectprovider.ROPInfo).
public void load(StateManagerImpl sm,
BitSet fields,
boolean setVersion,
com.solarmetric.kodo.runtime.objectprovider.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, com.solarmetric.kodo.runtime.JDOState, com.solarmetric.kodo.runtime.objectprovider.ROPInfo).
public Object getObjectId(Object input,
ClassMetaData meta)
throws Exception
CustomResultObjectProviderDetermine the id of the current data in
input.
getObjectId in interface CustomResultObjectProviderpublic PersistenceManagerImpl getPersistenceManager()
CustomResultObjectProviderPersistenceManagerImpl that objects loaded
by this provider should be loaded into.getPersistenceManager in interface CustomResultObjectProvider
public com.solarmetric.kodo.runtime.objectprovider.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 and load.
getROPInfo in interface CustomResultObjectProvider
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).
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.
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.
|
SolarMetric Kodo JDO 2.4.3 generated on March 27 2003 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||