Class SelectQueryPlan

    • Field Detail

      • ST_C_BUILT

        public static final int ST_C_BUILT
        This plans's constraints are already processed.
        See Also:
        Constant Field Values
      • ST_OC_BUILT

        public static final int ST_OC_BUILT
        This plans's order by constraints are already processed.
        See Also:
        Constant Field Values
      • constraint

        protected Constraint constraint
        Pointer to the retrieve descriptor's constraint stack. NOTE: The retrieve descriptor's stack will be modified building the query plan!
      • options

        public int options
        Bitmask constaining OPT_* Constants defined in RetrieveDescImpl
      • parentField

        protected ForeignFieldDesc parentField
        This foreign field joins this plan to the parent plan. The field is from config of the parent plan. Used only for dependent plan.
      • MULTILEVEL_PREFETCH_PROPERTY

        public static final String MULTILEVEL_PREFETCH_PROPERTY
        Name of the MULTILEVEL_PREFETCH property.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SelectQueryPlan

        public SelectQueryPlan​(ActionDesc desc,
                               SQLStoreManager store,
                               Concurrency concurrency)
        Creates a new SelectQueryPlan.
        Parameters:
        desc - Retrieve descriptor holding the query information from the query compiler. This information includes selected fields and the query constraints. desc must be an instance of RetrieveDescImpl.
        store - Store manager executing the query.
        concurrency - Query concurrency.
    • Method Detail

      • newInstance

        public static SelectQueryPlan newInstance​(RetrieveDescImpl desc,
                                                  SQLStoreManager store,
                                                  Concurrency concurrency)
        Creates a new instance of SelectQueryPlan depending on the retrieve descriptor options.
        Parameters:
        desc - The retrieve descriptor
        store - The store
        concurrency - The concurrency for the plan.
        Returns:
        An instance of SelectQueryPlan depending on the retrieve descriptor options.
      • getConstraint

        public Constraint getConstraint()
      • addTable

        protected void addTable​(LocalFieldDesc fieldDesc)
        The addTable method is used to add tables correponding to a field to the plan. No columns corresponding the field are added to the plan.
        Parameters:
        fieldDesc - The field for which we need to add table
      • addColumn

        protected void addColumn​(LocalFieldDesc fieldDesc)
        The addColumn method is used to specify a field for which data needs to be retrieved and therefore for which we need to select a column.
        Parameters:
        fieldDesc - The field for which we need to retrieve data and therefore for which we need to select a column.
      • processStatements

        protected void processStatements()
        Description copied from class: QueryPlan
        This method goes through the statement list and tries to set up relationship between statements based on secondary table keys.
        Overrides:
        processStatements in class QueryPlan
      • processFields

        protected void processFields()
        Process the fields from the retrieve descriptor's field list. Must be overwritten by subquery plans!
      • processConstraints

        protected void processConstraints()
      • addJoinConstraint

        protected void addJoinConstraint​(SelectQueryPlan fromPlan,
                                         SelectQueryPlan toPlan,
                                         ArrayList fromColumns,
                                         ArrayList toColumns,
                                         int joinOp)
        Put in a join constraint to the foreign table.
        Parameters:
        fromPlan - The plan for fromColumns
        toPlan - The plan for toColumns
        fromColumns - List of local columns.
        toColumns - List of foreign columns.
        joinOp - Join operation. This operation is never a non relationship join.
      • processOrderConstraints

        public void processOrderConstraints()
        Converts ConstraintFieldName used in Order by constraints into ConstraintFieldDesc using ConstraintFieldName#originalPlan.
        Currently unused functionality:
        Gets all the "order by" constraints from the the current stack. The constraints are ordered such that any "order by" constraint with position N is placed before any "order by" constraint with position N+m, where m > 0. Also any "order by" constraint with no position (i.e. position < 0) are placed immediately following the previous "order by" constraint with a position. The order of the "order by" constraints on the constraint stack is changed to effect this ordering. NOTE: The value constraints giving the position for the order by constraints is currently not generated by the query compiler.
      • getResult

        public Object getResult​(PersistenceManager pm,
                                ResultSet resultData)
                         throws SQLException
        Extract data from given resultData
        Parameters:
        pm - The PersistenceManager.
        resultData - The result set from which data is to be extracted.
        Returns:
        Result from the given resultData
        Throws:
        SQLException