Class AbstractResultClassMapper

java.lang.Object
org.datanucleus.store.query.inmemory.AbstractResultClassMapper
Direct Known Subclasses:
JDOQLResultClassMapper, JPQLResultClassMapper

public class AbstractResultClassMapper extends Object
Abstract mapper for getting results from a query. Extend for the specific query language.
  • Field Details

    • resultClass

      protected Class resultClass
  • Constructor Details

    • AbstractResultClassMapper

      public AbstractResultClassMapper(Class resultClass)
  • Method Details

    • map

      public Collection map(Collection inputResults, Expression[] resultNames)
      Method to map the input results to the required result class type.
      Parameters:
      inputResults - The results to process
      resultNames - Expressions for the result components of the input results (columns)
      Returns:
      Collection<resultClass>
    • getResultForResultSetRow

      Object getResultForResultSetRow(Object inputResult, String[] fieldNames, 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 query
      fieldNames - 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

      Field getFieldForFieldNameInResultClass(Class cls, 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 class
      fieldName - Name of the field
      Returns:
      The field