Class PersistentClassROF<T>
java.lang.Object
org.datanucleus.store.rdbms.query.AbstractROF<T>
org.datanucleus.store.rdbms.query.PersistentClassROF<T>
- Type Parameters:
T- Type of the persistent object that this creates
- All Implemented Interfaces:
ResultObjectFactory<T>
Result-object factory that takes a JDBC ResultSet, a results mapping, and creates a persistable object instance for each row in the ResultSet.
We use information in the result set to determine the object type; this can be a discriminator column, or can be a special "NucleusType" column defined just for result processing.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int[]protected StatementClassMappingPersistent class that this factory will generate (may be the root class).Resolved classes for metadata / discriminator keyed by class names.protected StatementClassMappingMapping of the results to members of this class (and sub-objects).protected ResultSetGetterprotected final org.datanucleus.metadata.AbstractClassMetaDataMetadata for the (root) persistable candidate class.Fields inherited from class AbstractROF
ec, fp, ignoreCache, rs, updateAllFields -
Constructor Summary
ConstructorsConstructorDescriptionPersistentClassROF(org.datanucleus.ExecutionContext ec, ResultSet rs, org.datanucleus.FetchPlan fp, StatementClassMapping resultMapping, org.datanucleus.metadata.AbstractClassMetaData acmd, Class<T> persistentClass) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate TfindObjectWithIdAndLoadFields(Object id, int[] membersToLoad, int[] membersToStore, Class<?> pcClass, org.datanucleus.metadata.AbstractClassMetaData cmd, Object surrogateVersion) Method to lookup an object for an id, and specify its FieldValues using the ResultSet.Method to convert the current ResultSet row into a persistable Object.Accessor for the JDBC ResultSet being processed.Methods inherited from class AbstractROF
setIgnoreCache, setUpdateAllFields
-
Field Details
-
rootCmd
protected final org.datanucleus.metadata.AbstractClassMetaData rootCmdMetadata for the (root) persistable candidate class. -
persistentClass
-
resultMapping
Mapping of the results to members of this class (and sub-objects). -
resultSetGetter
-
mappingDefinition
-
mappedFieldNumbers
protected int[] mappedFieldNumbers -
resolvedClasses
-
-
Constructor Details
-
PersistentClassROF
public PersistentClassROF(org.datanucleus.ExecutionContext ec, ResultSet rs, org.datanucleus.FetchPlan fp, StatementClassMapping resultMapping, org.datanucleus.metadata.AbstractClassMetaData acmd, Class<T> persistentClass) Constructor.- Parameters:
ec- ExecutionContextrs- ResultSet being processedfp- FetchPlanresultMapping- Mapping information for the result set and how it maps to the classacmd- MetaData for the (root) candidate classpersistentClass- Class that this factory will create instances of (or subclasses)
-
-
Method Details
-
getResultSet
Description copied from interface:ResultObjectFactoryAccessor for the JDBC ResultSet being processed.- Specified by:
getResultSetin interfaceResultObjectFactory<T>- Overrides:
getResultSetin classAbstractROF<T>- Returns:
- The ResultSet
-
getObject
Method to convert the current ResultSet row into a persistable Object.- Returns:
- The persistable object.
-
findObjectWithIdAndLoadFields
private T findObjectWithIdAndLoadFields(Object id, int[] membersToLoad, int[] membersToStore, Class<?> pcClass, org.datanucleus.metadata.AbstractClassMetaData cmd, Object surrogateVersion) Method to lookup an object for an id, and specify its FieldValues using the ResultSet. Works for all identity types.- Parameters:
id- The identity (DatastoreId, Application id, or SCOID when nondurable)membersToLoad- Absolute numbers of members to loadmembersToStore- Absolute numbers of members to store in StateManager (for later)pcClass- The class of the required object if knowncmd- Metadata for the typesurrogateVersion- The version when the object has a surrogate version field- Returns:
- The persistable object for this id
-