I know I can use setMaxResults and setFirstResult to handle pagination of a data set but I was wondering how people actually do it using DAO.
I was thinking of creating a Page class to deal with this information in action classes and set it in my DAO, where it might be an attribute, before invoking methods like getUsers(). These methods, like getUsers(), might instanciate Query, set its properties and call a generic get method, passing Query as parameter, which would read from class Page paging information like maxresults, initialPage.
I would apreciate any help.
thx in advance
joao
|