如果你简单的需要获得给定类的所有实例,你可以使用 list 方法:def books = Book.list()
list 方法支持分页参数:def books = Book.list(offset:10, max:20)
也可以排序:def books = Book.list(sort:"title", order:"asc")
这里,Here, the sort 参数是您想要查询的domain类中属性的名字,argument is the name of the domain class property that you wish to sort on, and the order
参数要么以argument is either asc for asc结束ending or要么以 desc for desc结束ending.