HHH-995 Order.ignoreCase() only works for VARCHAR types, not CHAR types

This commit is contained in:
Brett Meyer 2013-01-23 15:56:05 -05:00
parent 3220ca5b17
commit 09f8237d2f
1 changed files with 8 additions and 1 deletions

View File

@ -79,7 +79,14 @@ public class Order implements Serializable {
for ( int i=0; i<columns.length; i++ ) {
final StringBuilder expression = new StringBuilder();
SessionFactoryImplementor factory = criteriaQuery.getFactory();
boolean lower = ignoreCase && type.sqlTypes( factory )[i]==Types.VARCHAR;
boolean lower = false;
if ( ignoreCase ) {
int sqlType = type.sqlTypes( factory )[i];
lower = sqlType == Types.VARCHAR
|| sqlType == Types.CHAR
|| sqlType == Types.LONGVARCHAR;
}
if (lower) {
expression.append( factory.getDialect().getLowercaseFunction() ).append('(');
}