Obtaining a PagedResultList

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Obtaining a PagedResultList

Marcel Overdijk
I PagedResultList is very useful when you need just a section of data (using max/offset) and also need the total record count.

A PagedResultList can be obtained as follow:

def result = Book.createCriteria().list(max: params.max, offset: params.offset) {}


Can other methods as Book.list or Book.findAll also return a PagedResultList?


Maybe the PagedResultList should be documented somewhere in the user guide.