Class AbstractResultClassMapper
- java.lang.Object
-
- org.datanucleus.store.query.inmemory.AbstractResultClassMapper
-
- Direct Known Subclasses:
JDOQLResultClassMapper
,JPQLResultClassMapper
public class AbstractResultClassMapper extends java.lang.Object
Abstract mapper for getting results from a query. Extend for the specific query language.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Class
resultClass
-
Constructor Summary
Constructors Constructor Description AbstractResultClassMapper(java.lang.Class resultClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.lang.reflect.Field
getFieldForFieldNameInResultClass(java.lang.Class cls, java.lang.String fieldName)
Accessor for the Field for the specified field name of the supplied class.(package private) java.lang.Object
getResultForResultSetRow(java.lang.Object inputResult, java.lang.String[] fieldNames, java.lang.reflect.Field[] fields)
Method to take the result(s) of a row of the query and convert it into an object of the resultClass type, using the rules from the JDO spec.java.util.Collection
map(java.util.Collection inputResults, Expression[] resultNames)
Method to map the input results to the required result class type.
-
-
-
Method Detail
-
map
public java.util.Collection map(java.util.Collection inputResults, Expression[] resultNames)
Method to map the input results to the required result class type.- Parameters:
inputResults
- The results to processresultNames
- Expressions for the result components of the input results (columns)- Returns:
- Collection<resultClass>
-
getResultForResultSetRow
java.lang.Object getResultForResultSetRow(java.lang.Object inputResult, java.lang.String[] fieldNames, java.lang.reflect.Field[] fields)
Method to take the result(s) of a row of the query and convert it into an object of the resultClass type, using the rules from the JDO spec.- Parameters:
inputResult
- The result from the queryfieldNames
- Names of the fields (in the query, ordered)fields
- The Field objects for the fields of the result class (ordered)- Returns:
- Object of the resultClass type for the input result
-
getFieldForFieldNameInResultClass
java.lang.reflect.Field getFieldForFieldNameInResultClass(java.lang.Class cls, java.lang.String fieldName)
Accessor for the Field for the specified field name of the supplied class. Caters for the field being in superclasses.- Parameters:
cls
- The classfieldName
- Name of the field- Returns:
- The field
-
-