0

Suppose I have this code

Domain

class Parent{
   static hasMany =  [Childs:Child]
}


class Child {
   String name
}

Controller

def ParentInstance = Parent.get(1) //Parent.lock(1)

ParentInstance.Childs.each {
    //it.lock()
    it.name = "titi"
}

ParentInstance.save()

The lock should be added for each child instance or just adding it when getting the parent?

Jils
  • 783
  • 5
  • 12
  • 32

0 Answers0