Hibernate Hql find result size for paginator

Posted by KCore on Stack Overflow See other posts from Stack Overflow or by KCore
Published on 2010-04-15T07:40:41Z Indexed on 2010/04/15 7:43 UTC
Read the original article Hit count: 175

Filed under:
|
|
|

Hi, I need to add paginator for my Hibernate application. I applied it to some of my database operations which I perform using Criteria by setting Projection.count().This is working fine. But when I use hql to query, I can't seem to get and efficient method to get the result count. If I do query.list().size() it takes lot of time and I think hibernate does load all the objects in memory.

Can anyone please suggest an efficient method to retrieve the result count when using hql?

© Stack Overflow or respective owner

Related posts about java

Related posts about hibernate