diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkResource.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkResource.java b/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkResource.java index ad75c4c..45eeb2e 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkResource.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkResource.java @@ -267,12 +267,10 @@ public class BookmarkResource { From<?, Bookmark> bm; if (identity.isAnonymous()) { - var root = query.from(Bookmark.class); - bm = root; - query.select(root); - root.fetch(Bookmark_.owner, JoinType.LEFT); + bm = query.from(Bookmark.class); + query.select(bm); - var target = root.join(Bookmark_.targets); + var target = bm.join(Bookmark_.targets); query.where(cb.equal(target, Role.getWorld())); } else { var userName = identity.getPrincipal().getName(); @@ -281,9 +279,9 @@ public class BookmarkResource { var root = query.from(User.class); query.where(cb.equal(root, user)); bm = root.join(User_.visibleBookmarks); - bm.fetch(Bookmark_.owner, JoinType.LEFT); } + bm.fetch(Bookmark_.owner, JoinType.LEFT); query.orderBy(cb.desc(bm.get(Bookmark_.date))); if (owner != null) { |