HHH-17492 Allow parameter inferred mapping for same java types

This commit is contained in:
Marco Belladelli 2023-12-06 12:25:40 +01:00 committed by Christian Beikov
parent dc2c2823ed
commit b8d9552803
1 changed files with 2 additions and 1 deletions

View File

@ -5930,7 +5930,8 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
final JdbcMapping paramJdbcMapping = paramModelType.getSingleJdbcMapping();
final JdbcMapping inferredJdbcMapping = inferredValueMapping.getSingleJdbcMapping();
// Only use the inferred mapping as parameter type when the JavaType accepts values of the bind type
if ( inferredJdbcMapping.getMappedJavaType().isWider( paramJdbcMapping.getMappedJavaType() )
if ( ( inferredJdbcMapping.getMappedJavaType() == paramJdbcMapping.getMappedJavaType()
|| inferredJdbcMapping.getMappedJavaType().isWider( paramJdbcMapping.getMappedJavaType() ) )
// and the bind type is not explicit or the bind type has the same JDBC type
&& ( !bindingTypeExplicit || canUseInferredType( paramJdbcMapping, inferredJdbcMapping ) ) ) {
return resolveInferredValueMappingForParameter( inferredValueMapping );