HHH-18117 Proposed solution

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

View File

@ -5608,6 +5608,10 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
else if ( valueConverter.getRelationalJavaType().isInstance( 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,
// so we allow coercion between the number types
else if ( Number.class.isAssignableFrom( valueConverter.getRelationalJavaType().getJavaTypeClass() )