Hibernate version:3.1.2
MSSQL 2000
I am using Pager class i found on hibernate forum, to support Paging with Hibernate.
Sometimes, i have problem like this.
Criteria,itself returns correct result number. Then, i tried to used setFirstResult and setMaxResult to get only needed results.
Sometimes, this methods returns wrong number of results.
------------------------------------------------------------------
System.out.println("Page ="+page+"; pageSize ="+pageSize+";Full List Size ="+crit.list().size());
results = crit.setFirstResult(page * pageSize)
.setMaxResults(pageSize)
.list();
System.out.println("Pager size= "+results.size());
------------------------------------------------------------------
logging::
Page =0; pageSize =10; Full List Size =117
Pager size= 2
Where is the problem?
|