Search in sources :

Example 11 with OSQLFilterCondition

use of com.orientechnologies.orient.core.sql.filter.OSQLFilterCondition in project orientdb by orientechnologies.

the class OQueryOperatorNot method getBeginRidRange.

@Override
public ORID getBeginRidRange(Object iLeft, Object iRight) {
    if (iLeft instanceof OSQLFilterCondition) {
        final ORID beginRange = ((OSQLFilterCondition) iLeft).getBeginRidRange();
        final ORID endRange = ((OSQLFilterCondition) iLeft).getEndRidRange();
        if (beginRange == null && endRange == null)
            return null;
        else if (beginRange == null)
            return endRange;
        else if (endRange == null)
            return null;
        else
            return null;
    }
    return null;
}
Also used : OSQLFilterCondition(com.orientechnologies.orient.core.sql.filter.OSQLFilterCondition) ORID(com.orientechnologies.orient.core.id.ORID)

Example 12 with OSQLFilterCondition

use of com.orientechnologies.orient.core.sql.filter.OSQLFilterCondition in project orientdb by orientechnologies.

the class OQueryOperatorOr method getEndRidRange.

@Override
public ORID getEndRidRange(final Object iLeft, final Object iRight) {
    final ORID leftRange;
    final ORID rightRange;
    if (iLeft instanceof OSQLFilterCondition)
        leftRange = ((OSQLFilterCondition) iLeft).getEndRidRange();
    else
        leftRange = null;
    if (iRight instanceof OSQLFilterCondition)
        rightRange = ((OSQLFilterCondition) iRight).getEndRidRange();
    else
        rightRange = null;
    if (leftRange == null || rightRange == null)
        return null;
    else
        return leftRange.compareTo(rightRange) >= 0 ? leftRange : rightRange;
}
Also used : OSQLFilterCondition(com.orientechnologies.orient.core.sql.filter.OSQLFilterCondition) ORID(com.orientechnologies.orient.core.id.ORID)

Example 13 with OSQLFilterCondition

use of com.orientechnologies.orient.core.sql.filter.OSQLFilterCondition in project orientdb by orientechnologies.

the class OQueryOperatorTraverse method evaluateExpression.

@Override
protected boolean evaluateExpression(final OIdentifiable iRecord, final OSQLFilterCondition iCondition, final Object iLeft, final Object iRight, final OCommandContext iContext) {
    final OSQLFilterCondition condition;
    final Object target;
    if (iCondition.getLeft() instanceof OSQLFilterCondition) {
        condition = (OSQLFilterCondition) iCondition.getLeft();
        target = iRight;
    } else {
        condition = (OSQLFilterCondition) iCondition.getRight();
        target = iLeft;
    }
    final Set<ORID> evaluatedRecords = new HashSet<ORID>();
    return traverse(target, condition, 0, evaluatedRecords, iContext);
}
Also used : OSQLFilterCondition(com.orientechnologies.orient.core.sql.filter.OSQLFilterCondition) ORID(com.orientechnologies.orient.core.id.ORID) HashSet(java.util.HashSet)

Aggregations

OSQLFilterCondition (com.orientechnologies.orient.core.sql.filter.OSQLFilterCondition)13 ORID (com.orientechnologies.orient.core.id.ORID)8 ODocument (com.orientechnologies.orient.core.record.impl.ODocument)3 OSQLFilterItemField (com.orientechnologies.orient.core.sql.filter.OSQLFilterItemField)3 Map (java.util.Map)3 OIdentifiable (com.orientechnologies.orient.core.db.record.OIdentifiable)2 OProperty (com.orientechnologies.orient.core.metadata.schema.OProperty)2 OType (com.orientechnologies.orient.core.metadata.schema.OType)2 OCommandExecutionException (com.orientechnologies.orient.core.exception.OCommandExecutionException)1 ORecord (com.orientechnologies.orient.core.record.ORecord)1 OSQLFunctionRuntime (com.orientechnologies.orient.core.sql.functions.OSQLFunctionRuntime)1 OQueryOperator (com.orientechnologies.orient.core.sql.operator.OQueryOperator)1 OQueryOperatorEquals (com.orientechnologies.orient.core.sql.operator.OQueryOperatorEquals)1 OQueryOperatorNotEquals (com.orientechnologies.orient.core.sql.operator.OQueryOperatorNotEquals)1 OQueryOperatorNotEquals2 (com.orientechnologies.orient.core.sql.operator.OQueryOperatorNotEquals2)1 OSQLSynchQuery (com.orientechnologies.orient.core.sql.query.OSQLSynchQuery)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1