public class ResultClassROF extends Object implements ResultObjectFactory
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.
Constructor and Description |
---|
ResultClassROF(RDBMSStoreManager storeMgr,
Class cls,
StatementClassMapping classDefinition)
Constructor for a resultClass object factory where we have no result clause specified but a result class.
|
ResultClassROF(RDBMSStoreManager storeMgr,
Class cls,
StatementResultMapping resultDefinition)
Constructor for a resultClass object factory where we have a result clause specified.
|
ResultClassROF(RDBMSStoreManager storeMgr,
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(org.datanucleus.ExecutionContext ec,
ResultSet rs)
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.
|
public ResultClassROF(RDBMSStoreManager storeMgr, Class cls, StatementResultMapping resultDefinition)
storeMgr
- RDBMS StoreManagercls
- The result class to use (if any)resultDefinition
- The mapping information for the result expressionspublic ResultClassROF(RDBMSStoreManager storeMgr, Class cls, StatementClassMapping classDefinition)
storeMgr
- RDBMS StoreManagercls
- The result class to useclassDefinition
- The mapping information for the (candidate) classpublic ResultClassROF(RDBMSStoreManager storeMgr, Class cls, String[] resultFieldNames)
storeMgr
- RDBMS StoreManagercls
- The result class to useresultFieldNames
- Names for the result fieldspublic Object getObject(org.datanucleus.ExecutionContext ec, ResultSet rs)
getObject
in interface ResultObjectFactory
ec
- execution contextrs
- The ResultSet from the Query.protected Object getValueForNewObject(StatementNewObjectMapping newMap, org.datanucleus.ExecutionContext ec, ResultSet rs)
newMap
- new object mappingec
- ExecutionContextrs
- Query resultsCopyright © 2015. All rights reserved.