]
Ahmed Medhat Osman commented on HHH-4618:
-----------------------------------------
Dear friends, are there any update in this issue or are there any alternative solutions ?
Support pagination: total rows ignore limit
-------------------------------------------
Key: HHH-4618
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4618
Project: Hibernate Core
Issue Type: New Feature
Components: core
Environment: JBoss 5.1.0GA
Reporter: Dave
Limit is used for pagination, but total number of rows must be known to calculate page
count.
Currently we have to use two queries:
1. select * from Student where age<30 limit 20;
2. select count(*) from Student where age<30;
For complex query with joins/huge tables, it can be a performance issue.
For Criteria API query with group by, there is no way to get row count, for example
criteria.setProjection(Projection.projectionList().add(Projections.groupProperty("name")).add(Projections.sum(score)));
Currently there is no way to get row count of this query using Criteria API.
For MYSQL, SQL_CALC_FOUND_ROWS and FOUND_ROWS() are used to get row count ignoring
limit.
Pagination is used for all web application. Hibernate should support it in HQL and
Criteria API.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: