Hibernate: 3.0.5
database: mysql Ver 14.7
I think that my problem would be one that others have had, but I can not find any examples similar to my problem. I am trying to use the Criteria setFirstResult and setMaxResults to implement paging. For the examples that I have found they keep track of the page count and times it by the max results to get the starting location, what happens if in the middle the user in the GUI changes the max result count? Now your page count means nothing. I have no standard ID attribute that I can use as a key for the first result since they have ordered the table by a name attribute. I can not use the scrollable result because the server does not keep state from the GUI since there can be multiple ones attached and communicating at the same time. I am trying to not get all entries in the table because it can get very large over time. What I am trying to do is given an object find the row location it has after the ordering has been applied and use this location as my first result. Is there a way to do this other then get the full table and look through it? There must be a easier and better way.
Any and all ideas are appreciated.
|