tags:

views:

160

answers:

1

Probably a stupid question, but I tried looking this up without much success.

In a Grails app, I have a service with several methods that basically search for certain data using the Domain.createCriteria().list(...){...} construct. For one of those searches ("list all users") I now already have the data (part of a hasMany relationship). Now, as my views expects a PageResultList (as this is what Domain.createCriteria().list returns), I'd like to return a PageResultList as well.

However, Domain.users (static hasMany = [users : User]) seems to be of type PersistentSet and I do not know how to sort/search this and convert to a list to be returned as a PageResultList.

TIA for any help.

A: 

I don't know of an easy way to convert from PersistentSet to PagedResultList so I would just us a criteria for 'all user' as well. That way you don't have to mess around manually paginating the domain.users list.

leebutts