Grails findAll with sort, order, max and offset?

前端 未结 4 1487
时光取名叫无心
时光取名叫无心 2021-02-19 18:25

I want to integrate sort, order, max and offset in a findAll query. The following works fine:

def books = Book.findAll(\"from Book as b where b.approved=true ord         


        
4条回答
  •  不要未来只要你来
    2021-02-19 18:38

    Using "findAllBy" because it supports sort and order.

    def results = Book.findAllByTitle("The Shining",
                 [max: 10, sort: "title", order: "desc", offset: 100])
    

    Click here for details.

提交回复
热议问题