Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. create table person (id bigint),
  2. version bigint not null,
  3. primary key (id))
  4.  
  5. create table address (id bigint),
  6. person_id bigint not null,
  7. primary key (id))
  8.  
  9. class Person{
  10.  
  11. static hasMany = [
  12. addresses: Address
  13. ]
  14.  
  15. }
  16.  
  17.  
  18. class Address{
  19.  
  20. Address address
  21.  
  22. }
  23.  
  24. class Person{
  25.  
  26. static hasMany = [addresses: Address]
  27. }
  28.  
  29. class Address{
  30.  
  31. static belongsTo = [person : Person]
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement