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.
|