Class Constraint


  • public class Constraint
    extends Object
    • Field Detail

      • stack

        public List stack
        The stack that contains all constraints beside join constraints. Join constraints are handled by a separate stack.
    • Constructor Detail

      • Constraint

        public Constraint()
    • Method Detail

      • addField

        public void addField​(String name,
                             ActionDesc desc)
        Adds a field to the constraint stack. AddField creates a ConstraintField node for the indicated named field, optionally including an operation descriptor and adds it to the constraint stack.
        Parameters:
        name - The name parameter specifies the name of the field to be added to the constrant stack.
        desc - The desc parameter specifies an operation descriptor describing what is to be done with the field named by the name parameter.
      • addField

        public void addField​(LocalFieldDesc desc)
        Adds a field to the constraint stack. AddField creates a ConstraintFieldDesc node for the indicated field descriptor and adds it to the constraint stack.
        Parameters:
        desc - The Desc parameter is the field descriptor to be added to the constrant stack.
      • addField

        public void addField​(LocalFieldDesc desc,
                             QueryPlan plan)
        Adds a field to the constraint stack. AddField creates a ConstraintFieldDesc node for the indicated field descriptor and adds it to the constraint stack.
        Parameters:
        desc - The Desc parameter is the field descriptor to be added to the constrant stack.
        plan - The query plan to which this desc belongs
      • addForeignField

        public void addForeignField​(String name,
                                    ActionDesc desc)
      • addOperation

        public void addOperation​(int operation)
        Adds an operation to the constraint stack. AddOperation creates a ConstraintOperation node whose operation is operation and adds it to the constraint stack.
        Parameters:
        operation - The operation parameter specifies the operation to be added to the constrant stack.
      • addValue

        public void addValue​(Object value,
                             LocalFieldDesc localField)
        Adds a data value to the constraint stack. Creates a ConstraintValue node whose value is value and adds it to the constraint stack.
        Parameters:
        value - The value to be added to the constrant stack.
        localField - The localField to which this value is bound. Please note that localField can be null for values involved in complex expressions in a query.
      • addConstraintFieldSubQuery

        public void addConstraintFieldSubQuery​(String field,
                                               ActionDesc rd)
        Adds a subquery constraint on the stack.
        Parameters:
        field - The field on which subquery constraint is added.
        rd - Retrieve descriptor corresponding to the subquery.
      • addParamIndex

        public void addParamIndex​(int index,
                                  int enumType,
                                  LocalFieldDesc localField)
        Adds the index of a parameter to the stack.
        Parameters:
        index - the parameter index.
        enumType - the type for this parameter.
        localField - the localField to which this parameter is bound.
      • addJoinConstraint

        public void addJoinConstraint​(ConstraintJoin join)
        Adds specified join constraint. Equi joins are added to the constraint stack, outer joins are added to a separate stack, the outerJoinStack.
        Parameters:
        join - The join constraint to be added.
      • mergeConstraint

        public boolean mergeConstraint​(Constraint foreignConstraint,
                                       int joinOp)
        Merges the stack with the specified foreign constraint stack.
        Parameters:
        foreignConstraint - The constraint to be merged.
        joinOp - Join operation as defined in ActionDesc.
        Returns:
        True, if we need to add an additional "AND" constraint.
      • getConstraints

        public List getConstraints()
        Gets the where clause constraints for this Constraint
        Returns:
        The where clause constraints for this Constraint
      • getOuterJoinConstraints

        public List getOuterJoinConstraints()
        Gets the outer join constraints for this Constraint
        Returns:
        The outer join constraints for this Constraint