我有域类,TestUnit
如下所示。TestParameter
ParameterRange
class TestUnit {
static hasMany = [testParameters : TestParameter]
}
class TestParameter {
static hasMany = [paramRanges : ParameterRange ]
static belongsTo = [testUnit : TestUnit]
}
class ParameterRange {
static belongsTo = [testParam : TestParameter]
}
TestUnit
我想testUnitInstance.id
在ParameterRangeController
.
由于我是 grails 的新手,我不知道该怎么做,任何人都可以向我解释一下吗?
我试过的:
def testUnitId = params.testUnitId
def testUnitInstance = TestUnit.get(testUnitId)
def testParameterInstance = TestParameter.get(params.id)
[parameterRangeInstanceList: testParameterInstance.paramRanges, parameterRangeInstance: new ParameterRange(),testParameterInstance:testParameterInstance, page:"Range", testUnitInstance:testUnitInstance]