HHH-6809: Changed Loader.hasMaxRows() to return false if maxRows is zero, and removed bad expectation from FooBarTest.testFindByCriteria()

This commit is contained in:
John Verhaeg 2011-11-07 10:52:38 -06:00
parent ee020c8215
commit 8fcbf71a11
2 changed files with 1 additions and 5 deletions

View File

@ -1658,7 +1658,7 @@ public abstract class Loader {
}
private static boolean hasMaxRows(RowSelection selection) {
return selection != null && selection.getMaxRows() != null;
return selection != null && selection.getMaxRows() != null && selection.getMaxRows() > 0;
}
private static int getFirstRow(RowSelection selection) {

View File

@ -2003,10 +2003,6 @@ public class FooBarTest extends LegacyTestCase {
.addOrder( Order.asc("date") )
.list();
assertTrue( list.size()==1 && list.get(0)==f );
if(!(getDialect() instanceof TimesTenDialect || getDialect() instanceof HSQLDialect)) {
list = s.createCriteria(Foo.class).setMaxResults(0).list();
assertTrue( list.size()==0 );
}
list = s.createCriteria(Foo.class)
.setFirstResult(1)
.addOrder( Order.asc("date") )