mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Use right join on channels.
This commit is contained in:
parent
087fae17e9
commit
dfd7580374
1 changed files with 4 additions and 4 deletions
|
@ -108,7 +108,7 @@ public class FeedHandlers {
|
|||
// Get all videos from subscribed channels, with channel info
|
||||
CriteriaQuery<Video> criteria = cb.createQuery(Video.class);
|
||||
var root = criteria.from(Video.class);
|
||||
root.fetch("channel", JoinType.INNER);
|
||||
root.fetch("channel", JoinType.RIGHT);
|
||||
var subquery = criteria.subquery(User.class);
|
||||
var subroot = subquery.from(User.class);
|
||||
subquery.select(subroot.get("subscribed_ids"))
|
||||
|
@ -161,7 +161,7 @@ public class FeedHandlers {
|
|||
// Get all videos from subscribed channels, with channel info
|
||||
CriteriaQuery<Video> criteria = cb.createQuery(Video.class);
|
||||
var root = criteria.from(Video.class);
|
||||
root.fetch("channel", JoinType.INNER);
|
||||
root.fetch("channel", JoinType.RIGHT);
|
||||
var subquery = criteria.subquery(User.class);
|
||||
var subroot = subquery.from(User.class);
|
||||
subquery.select(subroot.get("subscribed_ids"))
|
||||
|
@ -222,7 +222,7 @@ public class FeedHandlers {
|
|||
// Get all videos from subscribed channels, with channel info
|
||||
CriteriaQuery<Video> criteria = cb.createQuery(Video.class);
|
||||
var root = criteria.from(Video.class);
|
||||
root.fetch("channel", JoinType.INNER);
|
||||
root.fetch("channel", JoinType.RIGHT);
|
||||
|
||||
criteria.select(root)
|
||||
.where(cb.and(
|
||||
|
@ -264,7 +264,7 @@ public class FeedHandlers {
|
|||
// Get all videos from subscribed channels, with channel info
|
||||
CriteriaQuery<Video> criteria = cb.createQuery(Video.class);
|
||||
var root = criteria.from(Video.class);
|
||||
root.fetch("channel", JoinType.INNER);
|
||||
root.fetch("channel", JoinType.RIGHT);
|
||||
|
||||
criteria.select(root)
|
||||
.where(cb.and(
|
||||
|
|
Loading…
Reference in a new issue