Guest User

Untitled

a guest
Mar 5th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.27 KB | None | 0 0
  1. class Owner {
  2.   List<Owned> owned
  3.   static hasMany = [owned:Owned]
  4. }
  5.  
  6. class Owned {
  7.   Owner owner
  8.   static belongsTo = [owner:Owner]
  9. }
  10.  
  11. class Test {
  12.   def runTest() {
  13.     def owner = new Owner(owned: [new Owned()])
  14.     assert null != owner.owned[0].owner
  15.   }
  16.  
  17. }
Add Comment
Please, Sign In to add comment