grails - gorm domain class shared property -
i have 4 classes
class process { string status } class request { string status = "incomplete" belongsto = [parent: parent] } class response { string status = "incomplete" static belongsto = [parent: parent] } class confirmation { string status = "incomplete" static belongsto = [parent: parent] }
then status of request, response or confirmation updated.
how can achieve autoupdate process.status status of last updated of other 3 classes ?
is there particular grails-way accomplish ?
without details on how domains mapped - relationship process request, response , confirmation - i'll assume have access process other domains.
with assumption, can use gorm events achieve update process.status
on afterupdate
event in other domains.
for example, in request, response , confirmation, can define like:
def afterupdate() { .. //get process how process.status = this.status }
Comments
Post a Comment