Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. class Parent{
  2. static hasMany = [Childs:Child]
  3. }
  4.  
  5.  
  6. class Child {
  7. String name
  8. }
  9.  
  10. def ParentInstance = Parent.get(1)
  11.  
  12.  
  13. ParentInstance.Childs.each {
  14. it.name = "titi"
  15. }
  16.  
  17. ParentInstance .save()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement