diff options
Diffstat (limited to 'src/main/java/eu')
-rw-r--r-- | src/main/java/eu/mulk/mulkcms2/benki/accesscontrol/Role.java | 5 | ||||
-rw-r--r-- | src/main/java/eu/mulk/mulkcms2/benki/users/User.java | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/accesscontrol/Role.java b/src/main/java/eu/mulk/mulkcms2/benki/accesscontrol/Role.java index 131fb69..b7dd6fc 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/accesscontrol/Role.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/accesscontrol/Role.java @@ -17,6 +17,7 @@ import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToMany; import javax.persistence.OneToMany; +import javax.persistence.OneToOne; import javax.persistence.Table; @Entity @@ -59,8 +60,8 @@ public class Role extends PanacheEntityBase { @OneToMany(mappedBy = "role", fetch = FetchType.LAZY) public Collection<UserRole> directUsers; - @OneToMany(mappedBy = "ownedRole", fetch = FetchType.LAZY) - public Collection<User> owningUsers; + @OneToOne(mappedBy = "ownedRole", fetch = FetchType.LAZY) + public User owningUsers; @ManyToMany(mappedBy = "effectiveRoles", fetch = FetchType.LAZY) public Collection<User> effectiveUsers; diff --git a/src/main/java/eu/mulk/mulkcms2/benki/users/User.java b/src/main/java/eu/mulk/mulkcms2/benki/users/User.java index 90b3318..6e16903 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/users/User.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/users/User.java @@ -16,8 +16,8 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToMany; -import javax.persistence.ManyToOne; import javax.persistence.OneToMany; +import javax.persistence.OneToOne; import javax.persistence.Table; @Entity(name = "BenkiUser") @@ -79,7 +79,7 @@ public class User extends PanacheEntityBase { @OneToMany(mappedBy = "user", fetch = FetchType.LAZY) public Collection<UserRsaKey> rsaKeys; - @ManyToOne(fetch = FetchType.LAZY) + @OneToOne(fetch = FetchType.LAZY) @JoinColumn(name = "role", referencedColumnName = "id", nullable = false) public Role ownedRole; |