Class CompositeOperandTypeChecker

  • All Implemented Interfaces:
    SqlOperandTypeChecker
    Direct Known Subclasses:
    CompositeSingleOperandTypeChecker

    public class CompositeOperandTypeChecker
    extends java.lang.Object
    implements SqlOperandTypeChecker
    This class allows multiple existing SqlOperandTypeChecker rules to be combined into one rule. For example, allowing an operand to be either string or numeric could be done by:
    
     CompositeOperandsTypeChecking newCompositeRule =
         new CompositeOperandsTypeChecking(Composition.OR,
             new SqlOperandTypeChecker[]{stringRule, numericRule});
     

    Similarly a rule that would only allow a numeric literal can be done by:

    
     CompositeOperandsTypeChecking newCompositeRule =
         new CompositeOperandsTypeChecking(Composition.AND,
             new SqlOperandTypeChecker[]{numericRule, literalRule});
     

    Finally, creating a signature expecting a string for the first operand and a numeric for the second operand can be done by:

    
     CompositeOperandsTypeChecking newCompositeRule =
         new CompositeOperandsTypeChecking(Composition.SEQUENCE,
             new SqlOperandTypeChecker[]{stringRule, numericRule});
     

    For SEQUENCE composition, the rules must be instances of SqlSingleOperandTypeChecker, and signature generation is not supported. For AND composition, only the first rule is used for signature generation.