Search in sources :

Example 1 with OQueryOperatorNot

use of com.orientechnologies.orient.core.sql.operator.OQueryOperatorNot in project orientdb by orientechnologies.

the class OSQLPredicate method extractCondition.

protected OSQLFilterCondition extractCondition() {
    if (!parserSkipWhiteSpaces())
        // END OF TEXT
        return null;
    // EXTRACT ITEMS
    Object left = extractConditionItem(true, 1);
    if (left != null && checkForEnd(left.toString()))
        return null;
    OQueryOperator oper;
    final Object right;
    if (left instanceof OQueryOperator && ((OQueryOperator) left).isUnary()) {
        oper = (OQueryOperator) left;
        left = extractConditionItem(false, 1);
        right = null;
    } else {
        oper = extractConditionOperator();
        if (oper instanceof OQueryOperatorNot)
            // SPECIAL CASE: READ NEXT OPERATOR
            oper = new OQueryOperatorNot(extractConditionOperator());
        right = oper != null ? extractConditionItem(false, oper.expectedRightWords) : null;
    }
    // CREATE THE CONDITION OBJECT
    return new OSQLFilterCondition(left, oper, right);
}
Also used : OQueryOperatorNot(com.orientechnologies.orient.core.sql.operator.OQueryOperatorNot) OQueryOperator(com.orientechnologies.orient.core.sql.operator.OQueryOperator)

Aggregations

OQueryOperator (com.orientechnologies.orient.core.sql.operator.OQueryOperator)1 OQueryOperatorNot (com.orientechnologies.orient.core.sql.operator.OQueryOperatorNot)1