How to set offset in GORM when using createCriteria?

Posted by firnnauriel on Stack Overflow See other posts from Stack Overflow or by firnnauriel
Published on 2010-05-13T14:40:04Z Indexed on 2010/05/13 14:44 UTC
Read the original article Hit count: 245

Filed under:
|

I'm just wondering if it's possible for 'createCriteria' to specify the paginateParams (i.e. offset) similar to dynamic finder (findAll, etc.)

Note that this code is not working since 'offset' is not documented in http://www.grails.org/doc/1.2.1/ref/Domain%20Classes/createCriteria.html

def c = SnbrItemActDistance.createCriteria()
def results = c.list {
    eq('iid', newsId)
    ge('distance', cap)

    maxResults(count)
    offset(offset)
    order('distance', 'desc')
}

© Stack Overflow or respective owner

Related posts about grails

Related posts about gorm