Use right join on channels.

This commit is contained in:
Kavin 2022-11-17 01:09:12 +00:00
parent 087fae17e9
commit dfd7580374
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD

View file

@ -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(