HHH-6849 Fixing assert in SQLServer2005DialectTestCase#testGetLimitString since order of column has changes. Also got rif of additional unnecessary whitespace

This commit is contained in:
Hardy Ferentschik 2011-11-25 17:24:44 +01:00 committed by Strong Liu
parent 06952b533e
commit 6e433d5f85
2 changed files with 2 additions and 2 deletions

View File

@ -194,6 +194,6 @@ public class SQLServer2005Dialect extends SQLServerDialect {
int selectEndIndex = sql.indexOf( FROM );
// Insert after the select statement the row_number() function:
sql.insert( selectEndIndex, ", ROW_NUMBER() OVER (" + orderby + ") as __hibernate_row_nr__ " );
sql.insert( selectEndIndex - 1, ", ROW_NUMBER() OVER (" + orderby + ") as __hibernate_row_nr__" );
}
}

View File

@ -64,6 +64,6 @@ public class SQLServer2005DialectTestCase extends BaseUnitTestCase {
String input = "select distinct f1 as f53245 from table849752 order by f234, f67 desc";
Dialect sqlDialect = new SQLServer2005Dialect();
assertEquals( "with query as (select row_number() over (order by f234, f67 desc) as __hibernate_row_nr__, f1 as f53245 from table849752 group by f1) select * from query where __hibernate_row_nr__ >= ? and __hibernate_row_nr__ < ?", sqlDialect.getLimitString(input, 10, 15).toLowerCase() );
assertEquals( "with query as (select f1 as f53245, row_number() over (order by f234, f67 desc) as __hibernate_row_nr__ from table849752 group by f1) select * from query where __hibernate_row_nr__ >= ? and __hibernate_row_nr__ < ?", sqlDialect.getLimitString(input, 10, 15).toLowerCase() );
}
}