-->
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: session.find() limiting the results coming
PostPosted: Tue Oct 21, 2003 6:24 pm 
Newbie

Joined: Tue Oct 21, 2003 6:14 pm
Posts: 11
IS there a way to get fixed length of entries from session.find()
or
the session.iterate() can it be optimized to retrieve a given set a time
for example

session.iterate("some query", int querySize);
when the query size is exausted then it would get the next querySize.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 22, 2003 8:28 pm 
Regular
Regular

Joined: Tue Sep 09, 2003 9:37 pm
Posts: 56
Location: Ogden, Utah, USA
If you use a query object you can do query.setMaxResults and query.setFirstResult to get a subset of the resultset. I'm not sure if it works in all dialects.

Query q = session.createQuery(hqlString);
q.setMaxResults(10);
q.list();

Jenica


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.