我必须在域类中,它们之间有很多很多关系。像下面的第一节
class HealthCenter {
List <FieldOfficer> fieldOfficers
static hasMany = [fieldOfficers:FieldOfficer]
static belongTo = FieldOfficer
}
第二课
class FieldOfficer{
List<HealthCenter> healthCenters
static hasMany = [healthCenters : HealthCenter]
}
我如何访问healthCenters
分配给fieldOfficers
以外的所有值,而不是以下
List<HealthCenter> healthCenters1
healthCenters1 = fieldOfficers.healthCenters
healthCenters1.each{i ->
print i
}