HHH-18117 Proposed solution

This commit is contained in:
Cedomir Igaly 2023-06-13 08:05:36 +02:00 committed by Christian Beikov
parent 5cf497f3c3
commit 0c0d4d5161
1 changed files with 4 additions and 0 deletions

View File

@ -5470,6 +5470,10 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
else if ( valueConverter.getRelationalJavaType().isInstance( value ) ) { else if ( valueConverter.getRelationalJavaType().isInstance( value ) ) {
sqlLiteralValue = value; sqlLiteralValue = value;
} }
else if ( Character.class.isAssignableFrom( valueConverter.getRelationalJavaType().getJavaTypeClass() )
&& value instanceof CharSequence && ( (CharSequence) value ).length() == 1 ) {
sqlLiteralValue = ( (CharSequence) value ).charAt( 0 );
}
// In HQL, number literals might not match the relational java type exactly, // In HQL, number literals might not match the relational java type exactly,
// so we allow coercion between the number types // so we allow coercion between the number types
else if ( Number.class.isAssignableFrom( valueConverter.getRelationalJavaType().getJavaTypeClass() ) else if ( Number.class.isAssignableFrom( valueConverter.getRelationalJavaType().getJavaTypeClass() )