Fetch user table as left join. (#304)

This commit is contained in:
Kavin 2022-07-04 08:37:52 +01:00 committed by GitHub
parent c812ace4f6
commit 7c087d82b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -335,7 +335,7 @@ public class ResponseHelper {
var root = cq.from(me.kavin.piped.utils.obj.db.Playlist.class); var root = cq.from(me.kavin.piped.utils.obj.db.Playlist.class);
root.fetch("videos", JoinType.LEFT) root.fetch("videos", JoinType.LEFT)
.fetch("channel", JoinType.LEFT); .fetch("channel", JoinType.LEFT);
root.fetch("owner", JoinType.INNER); root.fetch("owner", JoinType.LEFT);
cq.select(root); cq.select(root);
cq.where(cb.equal(root.get("playlist_id"), UUID.fromString(playlistId))); cq.where(cb.equal(root.get("playlist_id"), UUID.fromString(playlistId)));
var query = s.createQuery(cq); var query = s.createQuery(cq);
@ -435,7 +435,7 @@ public class ResponseHelper {
var root = cq.from(me.kavin.piped.utils.obj.db.Playlist.class); var root = cq.from(me.kavin.piped.utils.obj.db.Playlist.class);
root.fetch("videos", JoinType.LEFT) root.fetch("videos", JoinType.LEFT)
.fetch("channel", JoinType.LEFT); .fetch("channel", JoinType.LEFT);
root.fetch("owner", JoinType.INNER); root.fetch("owner", JoinType.LEFT);
cq.select(root); cq.select(root);
cq.where(cb.equal(root.get("playlist_id"), UUID.fromString(playlistId))); cq.where(cb.equal(root.get("playlist_id"), UUID.fromString(playlistId)));
var query = s.createQuery(cq); var query = s.createQuery(cq);