Search in sources :

Example 1 with LogicalOperator

use of io.requery.query.element.LogicalOperator in project requery by requery.

the class DefaultOutput method appendConditional.

@Override
public void appendConditional(LogicalElement element) {
    LogicalOperator op = element.getOperator();
    if (op != null) {
        switch(op) {
            case AND:
                qb.keyword(AND);
                break;
            case OR:
                qb.keyword(OR);
                break;
        }
    }
    Condition condition = element.getCondition();
    boolean nested = condition.getRightOperand() instanceof Condition;
    if (nested) {
        qb.openParenthesis();
    }
    appendOperation(condition, 0);
    if (nested) {
        qb.closeParenthesis().space();
    }
}
Also used : Condition(io.requery.query.Condition) LogicalOperator(io.requery.query.element.LogicalOperator)

Aggregations

Condition (io.requery.query.Condition)1 LogicalOperator (io.requery.query.element.LogicalOperator)1