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 f77e4d12d0
commit a0d97430fb
1 changed files with 8 additions and 1 deletions

View File

@ -71,7 +71,14 @@ public class Order implements Serializable {
StringBuilder fragment = new StringBuilder();
for ( int i=0; i<columns.length; i++ ) {
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) {
fragment.append( factory.getDialect().getLowercaseFunction() )
.append('(');