-->
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.  [ 3 posts ] 
Author Message
 Post subject: setMaxResults() not returning the correct # of rows
PostPosted: Fri Dec 07, 2007 11:19 am 
Newbie

Joined: Wed Jan 10, 2007 9:33 am
Posts: 13
Hi. I am calling setMaxResults on a Criteria instance and I pass it 1000 as the argument. The entity that I am running the query against is a view, and there are 13 rows in the view that I am running the query for. I am only receiving 10 rows back. This is taking place in a test environment, and there are no other updates taking place that remove rows from the view.

There is no other Criteria specified. I am only setting setMaxResults, and then calling list(). I just want row count <= N rows back. Why am I not receiving all 13 rows back? I am seeing the same problem on a different table that has > 200 rows. I specify 200, and I get back 10.

Any ideas?

Thanks.

Hibernate 3.2


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 07, 2007 1:59 pm 
Newbie

Joined: Fri May 25, 2007 2:09 pm
Posts: 6
Try setFirstResult(0)?

Also check property "hibernate.jdbc.fetch_size" is not set to 10


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 11, 2007 9:58 am 
Newbie

Joined: Wed Jan 10, 2007 9:33 am
Posts: 13
Thanks a lot! Looks like setFirstResults(0) did the trick...

When you pass 0 as the argument, this method says "start at the first row".


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

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.