class A {
hasMany = [b: B]
}
class B {
int type
String title
belongsTo = [a: A]
}
有没有办法get
或list
类型A
,其类型B
的集合按类型排序,另一个按标题排序?< / p>
答案 0 :(得分:0)
试试这段代码:
def listOfA = A.withCriteria {
eq "id", 123456
b {
and {
order "type", "desc"
order "title", "desc"
}
}
}