public class ResultClassROF extends AbstractROF
The resultClass will be used to create objects of that type when calling getObject(). The resultClass can be one of the following
Objects of this class are created in 2 distinct situations. The first is where a candidate class is available, and consequently field position mappings are available. The second is where no candidate class is available and so only the field names are available, and the results are taken in ResultSet order. These 2 modes have their own constructor.
ec, ignoreCache, rs
Constructor and Description |
---|
ResultClassROF(org.datanucleus.ExecutionContext ec,
ResultSet rs,
boolean ignoreCache,
Class cls,
StatementClassMapping classDefinition)
Constructor for a resultClass object factory where we have no result clause specified but a result class.
|
ResultClassROF(org.datanucleus.ExecutionContext ec,
ResultSet rs,
boolean ignoreCache,
Class cls,
StatementResultMapping resultDefinition)
Constructor for a resultClass object factory where we have a result clause specified.
|
ResultClassROF(org.datanucleus.ExecutionContext ec,
ResultSet rs,
boolean ignoreCache,
Class cls,
String[] resultFieldNames)
Constructor for cases where we have no candidate class and so have no mapping information
to base field positions on.
|
Modifier and Type | Method and Description |
---|---|
Object |
getObject()
Method to convert the ResultSet row into an Object of the ResultClass type.
|
protected Object |
getValueForNewObject(StatementNewObjectMapping newMap,
org.datanucleus.ExecutionContext ec,
ResultSet rs)
Convenience method to return the value of a NewObject mapping for the current row of the provided query results.
|
getResultSet
public ResultClassROF(org.datanucleus.ExecutionContext ec, ResultSet rs, boolean ignoreCache, Class cls, StatementResultMapping resultDefinition)
ec
- ExecutionContextrs
- ResultSet being processedignoreCache
- Whether we should ignore the cache(s) when instantiating persistable objectscls
- The result class to use (if any)resultDefinition
- The mapping information for the result expressionspublic ResultClassROF(org.datanucleus.ExecutionContext ec, ResultSet rs, boolean ignoreCache, Class cls, StatementClassMapping classDefinition)
ec
- ExecutionContextrs
- ResultSet being processedignoreCache
- Whether we should ignore the cache(s) when instantiating persistable objectscls
- The result class to useclassDefinition
- The mapping information for the (candidate) classpublic ResultClassROF(org.datanucleus.ExecutionContext ec, ResultSet rs, boolean ignoreCache, Class cls, String[] resultFieldNames)
ec
- ExecutionContextrs
- ResultSet being processedignoreCache
- Whether we should ignore the cache(s) when instantiating persistable objectscls
- The result class to useresultFieldNames
- Names for the result fieldspublic Object getObject()
protected Object getValueForNewObject(StatementNewObjectMapping newMap, org.datanucleus.ExecutionContext ec, ResultSet rs)
newMap
- new object mappingec
- ExecutionContextrs
- Query resultsCopyright © 2019. All rights reserved.