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 7688634e99..d97aa91b6e 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 @@ -5470,6 +5470,10 @@ public abstract class BaseSqmToSqlAstConverter 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() )