Search in sources :

Example 1 with BinaryExpressionPredicate

use of com.blazebit.persistence.parser.predicate.BinaryExpressionPredicate in project blaze-persistence by Blazebit.

the class EqualityCheckingVisitor method visit.

protected Boolean visit(BinaryExpressionPredicate predicate) {
    if (referenceExpression.getClass() != predicate.getClass()) {
        return Boolean.TRUE;
    }
    BinaryExpressionPredicate referencePredicate = (BinaryExpressionPredicate) referenceExpression;
    if (referencePredicate.isNegated() != predicate.isNegated()) {
        return Boolean.TRUE;
    }
    referenceExpression = referencePredicate.getLeft();
    if (predicate.getLeft().accept(this)) {
        return Boolean.TRUE;
    }
    referenceExpression = referencePredicate.getRight();
    return predicate.getRight().accept(this);
}
Also used : BinaryExpressionPredicate(com.blazebit.persistence.parser.predicate.BinaryExpressionPredicate)

Example 2 with BinaryExpressionPredicate

use of com.blazebit.persistence.parser.predicate.BinaryExpressionPredicate in project blaze-persistence by Blazebit.

the class AbstractQuantifiablePredicateBuilder method onBuilderEnded.

@Override
public void onBuilderEnded(SubqueryInternalBuilder<T> builder) {
    super.onBuilderEnded(builder);
    // set the finished subquery builder on the previously created predicate
    if (predicate instanceof BinaryExpressionPredicate) {
        ((BinaryExpressionPredicate) predicate).setRight(new SubqueryExpression(builder));
    } else {
        throw new IllegalStateException("SubqueryBuilder ended but predicate type was unexpected");
    }
    listener.onBuilderEnded(this);
}
Also used : BinaryExpressionPredicate(com.blazebit.persistence.parser.predicate.BinaryExpressionPredicate) QuantifiableBinaryExpressionPredicate(com.blazebit.persistence.parser.predicate.QuantifiableBinaryExpressionPredicate) SubqueryExpression(com.blazebit.persistence.parser.expression.SubqueryExpression)

Aggregations

BinaryExpressionPredicate (com.blazebit.persistence.parser.predicate.BinaryExpressionPredicate)2 SubqueryExpression (com.blazebit.persistence.parser.expression.SubqueryExpression)1 QuantifiableBinaryExpressionPredicate (com.blazebit.persistence.parser.predicate.QuantifiableBinaryExpressionPredicate)1