Hi, I'm new to Hibernate. Would like to ask a pretty simple question.
How do i query for the total number of rows in a table. Like a select count(*) ..
This is a Pagination related question, where i have used the sample Page class implementation provided by Gavin King. However, would like to make some modifications, where instead of simply allowing for a next and previous, would like to present the total number of pages to be displayed.
So that the presentation tier could request for a specific page.
Therefore for the initial request, would like to return along with the first pages results, the total number of pages. (hence the request for how to perform the select count(*)... ) I would not want to fetch all the objects, instead just return an int or something with the total number of rows matching my query.
Thanks in advance.
Roshan
Hibernate version:
Hibernate version 2.1.6
DB : DB2 8.1
|