Menu

How to use ComboCondition with Selectquery?

IDMS
2014-12-12
2014-12-15
  • IDMS

    IDMS - 2014-12-15

    Thank you.

    I have tried above url thatyou provided.

    My issue is like:

    selectQuery1.addCondition(ComboCondition.or(BinaryCondition.lessThan(_defTable1_col1, inputColumn.get(Constants.VALUE), false)));

    selectQuery1.addCondition(ComboCondition.or(BinaryCondition.greaterThan(_defTable1_col1, inputColumn.get(Constants.VALUE), false)));

    I am trying to combine these 2 queries using OR; these queries are coming from a for loop, with the increment of i;

    Thanks again

     
  • James Ahlborn

    James Ahlborn - 2014-12-15

    Then you need to keep a handle to the ComboCondition that you created and continue to add the BinaryConditions to it:

    ComboCondition orCond = ComboCondition.or();
    selectQuery1.addCondition(orCond);
    
    for( ... ) {
      orCond.addCondition(BinaryCondition.lessThan(_defTable1_col1,
          inputColumn.get(Constants.VALUE), false)));
    }
    

    A ComboCondition is a "container" which holds all of the conditions which will be combined by a given operator.

     

    Last edit: James Ahlborn 2014-12-15

Log in to post a comment.