From 4ad837d587db9bb2b52a617ce4804c3be7b74e02 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Mon, 27 Jan 2020 06:29:07 +0100 Subject: JPA: Make all many-to-many collections sets. This improves performance when inserting new elements. Change-Id: I7c85d893984deb9ac4ba93ea34075c589a27e82e --- src/main/java/eu/mulk/mulkcms2/benki/accesscontrol/Role.java | 2 +- 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 effectiveUsers; + public Set 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 wikiPageRevisions; @ManyToMany(mappedBy = "visibleTo", fetch = FetchType.LAZY) - public Collection visiblePosts; + public Set visiblePosts; @ManyToMany(fetch = FetchType.LAZY) @JoinTable( -- cgit v1.2.3