I am using server side pagination.For that initially i need to show first 100 records first and the no of buttons on the top.For example total i have 550 records i need to show 6 buttons at the top.When user clicks on second button i need to retrieve 101 to 199 records.
To get the total records i am using one database call and to get the first 100 records i am using another database call.
I am using hibernate ,so the query is like this
select model from TableName model where ................
FirstResult = 0
MaxResult = 100
And to get the total no of records i am using
select count(*) from TableName model where ................
Here the problem is i am running the similar query for 2 times. How i can combine these 2 queries into one?
Thanks in advance...