use of org.hibernate.sql.ast.tree.predicate.BetweenPredicate in project hibernate-orm by hibernate.
the class ExpressionReplacementWalker method visitBetweenPredicate.
@Override
public void visitBetweenPredicate(BetweenPredicate betweenPredicate) {
final Expression expression = replaceExpression(betweenPredicate.getExpression());
final Expression lowerBound = replaceExpression(betweenPredicate.getLowerBound());
final Expression upperBound = replaceExpression(betweenPredicate.getUpperBound());
if (expression != betweenPredicate.getExpression() || lowerBound != betweenPredicate.getLowerBound() || upperBound != betweenPredicate.getUpperBound()) {
returnedNode = new BetweenPredicate(expression, lowerBound, upperBound, betweenPredicate.isNegated(), betweenPredicate.getExpressionType());
} else {
returnedNode = betweenPredicate;
}
}
use of org.hibernate.sql.ast.tree.predicate.BetweenPredicate in project hibernate-orm by hibernate.
the class BaseSqmToSqlAstConverter method visitBetweenPredicate.
@Override
public BetweenPredicate visitBetweenPredicate(SqmBetweenPredicate predicate) {
final FromClauseIndex fromClauseIndex = fromClauseIndexStack.getCurrent();
final Expression expression;
final Expression lowerBound;
final Expression upperBound;
inferrableTypeAccessStack.push(() -> coalesceSuppliedValues(() -> determineValueMapping(predicate.getLowerBound(), fromClauseIndex), () -> determineValueMapping(predicate.getUpperBound(), fromClauseIndex)));
try {
expression = (Expression) predicate.getExpression().accept(this);
} finally {
inferrableTypeAccessStack.pop();
}
inferrableTypeAccessStack.push(() -> coalesceSuppliedValues(() -> determineValueMapping(predicate.getExpression(), fromClauseIndex), () -> determineValueMapping(predicate.getUpperBound(), fromClauseIndex)));
try {
lowerBound = (Expression) predicate.getLowerBound().accept(this);
} finally {
inferrableTypeAccessStack.pop();
}
inferrableTypeAccessStack.push(() -> coalesceSuppliedValues(() -> determineValueMapping(predicate.getExpression(), fromClauseIndex), () -> determineValueMapping(predicate.getLowerBound(), fromClauseIndex)));
try {
upperBound = (Expression) predicate.getUpperBound().accept(this);
} finally {
inferrableTypeAccessStack.pop();
}
return new BetweenPredicate(expression, lowerBound, upperBound, predicate.isNegated(), getBooleanType());
}
Aggregations