1
我使用的Grails 3.2:查找isDirty()兒童元素
class Training{
boolean clientChanged = false
static transients = ['clientChanged']
static hasMany = [clients:User]
//...
def beforeUpdate(){
clientChanged = this.isDirty('clients')
}
def afterUpdate(){
if(clientChanged && section.clients)
numberOfAbsentClients = section.clients.size() - (clients.size()?:0)
}
}
isDirty()
不工作的hasMany關聯。我該如何處理?
作爲魅力。謝謝! –