Skip to content

Commit

Permalink
HHH-17492 Allow parameter inferred mapping for same java types
Browse files Browse the repository at this point in the history
  • Loading branch information
mbladel authored and beikov committed Jan 12, 2024
1 parent dc2c282 commit b8d9552
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5930,7 +5930,8 @@ else if ( paramType instanceof MappingModelExpressible<?> ) {
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 );
Expand Down

0 comments on commit b8d9552

Please sign in to comment.