Grails

Return PagedResultList in case list* methods are provided with max and offset param

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0.1
  • Fix Version/s: 2.0-RC2
  • Component/s: Persistence
  • Labels:
    None

Description

As far as I know only when using criteria Grails will return a PagedResultList.

It would be really nice if all list* methods would do this in case max and/or offset params are specified.

E.g. how it is currently

def result = Book.createCriteria().list(max: params.max, offset: params.offset) {}
assert result instanceof PagedResultList => TRUE

def result = Book.list(max: 10, offset: 0)
assert result instanceof PagedResultList => FALSE

Issue Links

Activity

Hide
Marcel Overdijk added a comment -

Same for the findAll* methods

Show
Marcel Overdijk added a comment - Same for the findAll* methods
Hide
Robert Watts added a comment -

Add executeQueryv methods

Show
Robert Watts added a comment - Add executeQueryv methods
Hide
Allan Dixon added a comment -

Any update on this?

Show
Allan Dixon added a comment - Any update on this?
Hide
Graeme Rocher added a comment -

Jeff - could you look at this? I think you did something in this area recently

Show
Graeme Rocher added a comment - Jeff - could you look at this? I think you did something in this area recently
Hide
Jeff Brown added a comment -

Graeme - Will do.

Show
Jeff Brown added a comment - Graeme - Will do.
Hide
Graeme Rocher added a comment -

How does one control whether you get 2 queries or 1?

https://github.com/grails/grails-core/commit/723b6239e279e55613ff743d5c22b305207b092d

Right now you always get 2 queries and there is no way to control whether you want the count as well or not?

Show
Graeme Rocher added a comment - How does one control whether you get 2 queries or 1? https://github.com/grails/grails-core/commit/723b6239e279e55613ff743d5c22b305207b092d Right now you always get 2 queries and there is no way to control whether you want the count as well or not?
Hide
Jeff Brown added a comment -

The static list(...) method now returns a PagedResultList for paginated queries.

Show
Jeff Brown added a comment - The static list(...) method now returns a PagedResultList for paginated queries.

People

Vote (18)
Watch (17)

Dates

  • Created:
    Updated:
    Resolved: