commit | 4ad837d587db9bb2b52a617ce4804c3be7b74e02 | [log] [tgz] |
---|---|---|
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | Mon Jan 27 06:29:07 2020 +0100 |
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | Mon Jan 27 06:29:31 2020 +0100 |
tree | c379cc6639eaa0e1ad94802efc3a8183ef81b91a | |
parent | d50bbb75b8018be054b840cbae6b8e0c48b514ea [diff] |
JPA: Make all many-to-many collections sets. This improves performance when inserting new elements. Change-Id: I7c85d893984deb9ac4ba93ea34075c589a27e82e
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 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 Collection<WikiPageRevision> wikiPageRevisions; @ManyToMany(mappedBy = "visibleTo", fetch = FetchType.LAZY) - public Collection<Post> visiblePosts; + public Set<Post> visiblePosts; @ManyToMany(fetch = FetchType.LAZY) @JoinTable(