SHARE
TWEET

Untitled

a guest Oct 13th, 2017 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @Entity
  2. @Table(name = "users")
  3. data class User(
  4.         @Id @GeneratedValue val id: Long? = null,
  5.         var name: String = "",
  6.         @OneToOne var profile: Profile? = null
  7. )
  8.    
  9. @Entity
  10. @Table(name = "profile")
  11. data class Profile (
  12.         @Id @GeneratedValue val id: Long? = null,
  13.         @OneToOne var user: User? = null,
  14.         @OneToMany var subscribers: Set<User>? = null,
  15.         @OneToMany var subscriptions: Set<User>? = null,
  16. )
RAW Paste Data
Top