このコードがあるとします
ドメイン
class Parent{
static hasMany = [Childs:Child]
}
class Child {
String name
}
コントローラ
def ParentInstance = Parent.get(1) //Parent.lock(1)
ParentInstance.Childs.each {
//it.lock()
it.name = "titi"
}
ParentInstance.save()
子インスタンスごとにロックを追加する必要がありますか、それとも親を取得するときにロックを追加するだけですか?