-->
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.  [ 2 posts ] 
Author Message
 Post subject: How can we get the full resultset size when paging?
PostPosted: Sun Apr 04, 2004 12:38 pm 
Newbie

Joined: Wed Jan 21, 2004 2:18 pm
Posts: 4
Location: Melbourne.Australia
as title.
when we use query.setFirstResult(n),it will cut down the part of result set.so how can we get the total result size when paging using only one hql?

thanks all


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 05, 2004 7:50 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
You can't since Hibernate use JDBC APIs to reduce resultset size.
You can count the number of query results without actually returning them:

Code:
( (Integer) session.iterate("select count(*) from ....").next() ).intValue()

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.