Hi
I am doing a HTML search screen which needs to paginate results 10 records per page. I have it working, but am currently executing 2 queries, one for the page, and one for the count of total num results.
I have read around the pagination articles and read that it is possible to get a page of results, + the total number results of a query in ONE query... Quote:
"in particular you will have to insert Oracle's proprietary rownum modifiers into the generated SQL: by using Cached RowSet and cachedRowset.getRow() you get the row count of a query without scanning all the rows or issue a separate SELECT COUNT(*)."
My current paging example uses Criteria, is there an example of inserting Oracle's proprietary rownum modifiers in the generated SQL by using Cached RowSet ?
Or can anyone provide some pseudo ? as I am not sure how to do this..
Hibernate version:3.0.5
|