-->
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: use hibernatetemplate to select from middle of results?
PostPosted: Fri Aug 28, 2009 9:46 pm 
Newbie

Joined: Fri Jul 13, 2007 7:22 pm
Posts: 4
I need to get at the records in the middle of a table, but the table is too large to load the entire thing into memory. In SQL this could be accomplished (admittedly somewhat inefficiently) like this:

select top 10 (*) from post where id not in(SELECT top 10 id from post order by postdate) order by postdate

This would select records 11 through 21. Unfortunately, this can't be translated into hql because hql doesn't support the top statement.

I've been using HibernateTemplate and HQL in the rest of my code, so I'd prefer to continue doing things that way.

Any ideas?


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.