我有域类workpackage,activity和aw。
如何从workpackage获取活动id值。
class Aw {
Activity activity
static hasMany=[activity:Activity]
Workpackage workpackage
static belongsTo=[workpackage:Workpackage]
static constraints = {
workpackage nullable:true
activity nullable:true
}
}
答案 0 :(得分:0)
Workpackage有很多活动。就是这样。没有PW或AW类。如果您想从活动中获取项目ID,只需写入
def myactivity = Activity.get(passed_id);
def wanted_id = my_activity.workpackage.project.id.
如果我没有正确理解这个问题,请详细解释。