When creating a predicate for an entity book, I would like to be able to left join the category (ManyToMany) to add an I-Predicate to the category. I could just achieve this if I have a JPAQuery instance:
if (catId != null) { jpaQuery.leftJoin(book.categories, category); jpaQuery.where(category.id.eq(catId).or(category.parentCategory.id.eq(catId))); }
But when creating Predicates, I don't have JPAQuery yet. Therefore, for the Predicate itself, I could do:
booleanBuilder.and(category.id.eq(this.categoryId).or(category.parentCategory.id.eq(this.categoryId)));
But for leftjoin, how to act without jpaQuery instance?
source share