-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: setFirstResult and setMaxResults problem (hbm 3.1 mssql2000)
PostPosted: Wed May 09, 2007 4:45 am 
Newbie

Joined: Wed Mar 28, 2007 7:30 am
Posts: 3
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.