公共培训班
class PublicTraining{
static hasMany = [trainingOrder: TrainingOrder]
}
和 TrainingOrder 类
class TrainingOrder {
Date createdOn
static mapping = {
sort id:"asc"
}
}
如果我想获得所有培训订单
def orders = publicTrainingInstance.trainingOrder.sort()
println orders // [59,58] (id of orders)
不给出排序的订单