我想在 findAll 查询中集成排序、顺序、最大值和偏移量。以下工作正常:
def books = Book.findAll("from Book as b where b.approved=true order by b.dateCreated desc", [max: max, offset: offset])
但我想要的是:
def books = Book.findAll("from Book as b where b.approved=true", [sort: 'dateCreated', order: 'desc', max: max, offset: offset])
这不起作用。我该如何重写这个?