use of io.micronaut.data.model.jpa.criteria.impl.predicate.PredicateBinaryOp in project micronaut-data by micronaut-projects.
the class QueryModelPredicateVisitor method visit.
@Override
public void visit(PersistentPropertyBinaryPredicate<?> propertyToExpressionOp) {
PersistentPropertyPath<?> propertyPath = propertyToExpressionOp.getPropertyPath();
PredicateBinaryOp op = propertyToExpressionOp.getOp();
Expression<?> expression = propertyToExpressionOp.getExpression();
visitPropertyPathPredicate(propertyPath, expression, op);
}
use of io.micronaut.data.model.jpa.criteria.impl.predicate.PredicateBinaryOp in project micronaut-data by micronaut-projects.
the class QueryModelPredicateVisitor method visit.
@Override
public void visit(ExpressionBinaryPredicate expressionBinaryPredicate) {
Expression<?> left = expressionBinaryPredicate.getLeft();
PredicateBinaryOp op = expressionBinaryPredicate.getOp();
if (left instanceof PersistentPropertyPath) {
visitPropertyPathPredicate((PersistentPropertyPath<?>) left, expressionBinaryPredicate.getRight(), op);
} else if (left instanceof IdExpression) {
if (op == PredicateBinaryOp.EQUALS) {
add(Restrictions.idEq(asValue(expressionBinaryPredicate.getRight())));
} else {
throw new IllegalStateException("Unsupported ID expression OP: " + op);
}
} else {
throw new IllegalStateException("Unsupported expression: " + left);
}
}
Aggregations