-->
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 Achieve FETCH ONLY 'N' Clause functionality in HB
PostPosted: Thu Aug 03, 2006 9:06 am 
Newbie

Joined: Tue Aug 01, 2006 8:31 am
Posts: 6
Hi All,

How can i get the n number of records from a table by using Hibernate.

Like we have in DB2 FETCH ONLY clause.


Please help me out it is an urgent requirement for me.

Regards
Sreenivasula Reddy A


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 03, 2006 9:15 am 
Newbie

Joined: Tue Mar 21, 2006 4:19 am
Posts: 15
Query q = session.createQuery("....");
q.setFirstResult(1);
q.setMaxResults(20);
with this code you`ll get the results from 1 to 20.


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.