Reputation: 11645
May be a basic question.. I am doing
MyDomain.dirtyPropertyNames.each {
aInstance.oldVal = newDomainObject.getPersistentValue(it)
aInstance.newVal = ? // how to get the property value here from the list obviously MyDomain.it doesnt work..
aInstance.save()
}
The dirtyPropertyNames is a list of Property name Strings, how do I get the Domain.property of each property in the list?
Thanks
Upvotes: 0
Views: 3898
Reputation: 1244
I prefer the following form for property access through a name.
myDomain[it]
For instance, if your property name is "lockedFlag" the following are true.
assert myDomain.lockedFlag == myDomain["lockedFlag"]
assert myDomain.lockedFlag == myDomain."lockedFlag"
I hope this helps.
Upvotes: 2