This commit is contained in:
lor6 2017-05-16 17:00:41 +03:00 committed by Grzegorz Piwowarek
parent 63611daf7b
commit ee79ac3a02
1 changed files with 1 additions and 1 deletions

View File

@ -110,7 +110,7 @@ public class FooPaginationPersistenceIntegrationTest {
final String countQ = "Select count (f.id) from Foo f";
final Query countQuery = session.createQuery(countQ);
final Long countResults = (Long) countQuery.uniqueResult();
final int lastPageNumber = (int) ((countResults / pageSize) + 1);
final int lastPageNumber = (int) (Math.ceil(countResults / pageSize));
final Query selectQuery = session.createQuery("From Foo");
selectQuery.setFirstResult((lastPageNumber - 1) * pageSize);