Class ResultDesc


  • public class ResultDesc
    extends Object
    This class is used by the store to materialize objects from a JDBC resultset. Each ResultDesc binds values from the ResultSet to instances of a persistence capable class.
    • Constructor Detail

      • ResultDesc

        public ResultDesc​(ClassDesc config,
                          int aggregateResultType)
    • Method Detail

      • addField

        public void addField​(LocalFieldDesc fieldDesc,
                             ColumnRef columnRef,
                             boolean projection)
        Create and add a ResultFieldDesc for the given fieldDesc and columnRef.
        Parameters:
        fieldDesc - - the field descriptor for the field that is the recipient of the result value indicated by the columnRef.
        columnRef - - indicates which column in the resultset contains the value.
        projection - - indicates whether the column is a projection
      • setPrefetching

        public void setPrefetching()
      • setParentField

        public void setParentField​(ForeignFieldDesc parentField)
        Set the field that is the recipient of the result of this ResultDesc.
        Parameters:
        parentField - - field descriptor for the recipient field of the value of this ResultDesc.
      • getResult

        public Object getResult​(PersistenceManager pm,
                                ResultSet resultData)
                         throws SQLException
        Materialize data from the result set into objects.
        Parameters:
        pm - - the PersistenceManager responsible for instantiating objects
        resultData - - JDBC ResultSet containing the data to be materialized
        Returns:
        Collection containing the resulting objects. For aggregate queries, the returned object type is specified by the caller.
        Throws:
        SQLException
      • doJoin

        public void doJoin​(ResultDesc foreignResult,
                           ForeignFieldDesc parentField)
        Joins foreignResult with this resultDesc
        Parameters:
        foreignResult - the foreign ResultDesc
        parentField - parentField for the foreind ResultDesc