From e509625af8720717d8611317d29b3bb6587be6b9 Mon Sep 17 00:00:00 2001 From: Marco Belladelli Date: Mon, 27 Feb 2023 10:46:38 +0100 Subject: [PATCH] HHH-16211 Remove type inference from like predicate's escape character --- .../hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java index f1c5deae3b..9756287764 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java @@ -6920,9 +6920,9 @@ public abstract class BaseSqmToSqlAstConverter extends Base return new LikePredicate( visitWithInferredType( predicate.getMatchExpression(), predicate.getPattern() ), visitWithInferredType( predicate.getPattern(), predicate.getMatchExpression() ), - predicate.getEscapeCharacter() == null - ? null - : visitWithInferredType( predicate.getEscapeCharacter(), predicate.getMatchExpression() ), + predicate.getEscapeCharacter() == null ? + null : + (Expression) visitWithInferredType( predicate.getEscapeCharacter(), () -> basicType( Character.class ) ), predicate.isNegated(), predicate.isCaseSensitive(), getBooleanType()