diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2020-01-27 06:29:07 +0100 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2020-01-27 06:29:31 +0100 |
commit | 4ad837d587db9bb2b52a617ce4804c3be7b74e02 (patch) | |
tree | c379cc6639eaa0e1ad94802efc3a8183ef81b91a | |
parent | d50bbb75b8018be054b840cbae6b8e0c48b514ea (diff) |
JPA: Make all many-to-many collections sets.
This improves performance when inserting new elements.
Change-Id: I7c85d893984deb9ac4ba93ea34075c589a27e82e
-rw-r--r-- | src/main/java/eu/mulk/mulkcms2/benki/accesscontrol/Role.java | 2 | ||||
-rw-r--r-- | src/main/java/eu/mulk/mulkcms2/benki/users/User.java | 2 |
2 files changed, 2 insertions, 2 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 b3efeb9..7c0db71 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/accesscontrol/Role.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/accesscontrol/Role.java @@ -69,7 +69,7 @@ public class Role extends PanacheEntityBase { public User owningUsers; @ManyToMany(mappedBy = "effectiveRoles", fetch = FetchType.LAZY) - public Collection<User> effectiveUsers; + public Set<User> effectiveUsers; @ElementCollection(fetch = FetchType.LAZY) @CollectionTable(name = "role_tags", schema = "benki", joinColumns = @JoinColumn(name = "role")) 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 72a63f6..3e6559c 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/users/User.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/users/User.java @@ -111,7 +111,7 @@ public class User extends PanacheEntityBase { public Collection<WikiPageRevision> wikiPageRevisions; @ManyToMany(mappedBy = "visibleTo", fetch = FetchType.LAZY) - public Collection<Post> visiblePosts; + public Set<Post> visiblePosts; @ManyToMany(fetch = FetchType.LAZY) @JoinTable( |