def names = domain.dirtyPropertyNames
for (name in names) {
def originalValue = domain.getPersistentValue(name)
def newValue = domain."$name"
}
但是如果我与其他域有 1-1 的关系
我如何访问该其他域的dirtyPropertyNames
def dirtyProperties = domain?.otherDomain?.dirtyPropertyNames
for (name in dirtyProperties ) {
def originalValue = domain?.otherDomain?.getPersistentValue(name)
def newValue = domain?.otherDomain?."$name"
}
但我得到没有这样的属性:dirtyPropertyNames for class: otherDomain