-->
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: Counting HQL result
PostPosted: Fri Jun 10, 2005 7:26 pm 
Newbie

Joined: Thu May 12, 2005 2:28 pm
Posts: 2
Hi.

I have an HQL which returns too many rows to not to use pagination. The hql is a join between too classes and has a 'having' clause. The fact is that I need to count the total number of result objects (not only the ones I select on the current page) and

It's something like this
select sum(movs.amount),mae.cod
from mae join mae.movements movs
having sum(movs.amount) > 0

In raw SQL I would use a subselect to wrappe the entire statement and count the quantity in this subselect, but since Hibernate doesn't support subqueries in the from clause, I dont know how to handle this. I will appreciate any comentary.

Thank :-)

P/S: Sorry I this sounds too stupid.


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.