HHH-6809: Changed Loader.hasMaxRows() to return false if maxRows is zero, and removed bad expectation from FooBarTest.testFindByCriteria()
This commit is contained in:
parent
ee020c8215
commit
8fcbf71a11
|
@ -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) {
|
||||
|
|
|
@ -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") )
|
||||
|
|
Loading…
Reference in New Issue