I\'m using spring-data-jpa and querydsl (3.2.3) I have a scenario where I\'m creating set of predicates based on user filer/input. All of these comes to BooleanEx
BooleanEx
Here is a variant of jaiwo99's answer in a more JPAesque form
BooleanExpression exp = invoice.supplier.number.in(new JPASubQuery() .from(company) .where(company.active.isTrue()) .list(company.number));
Feel free to merge this into the original answer.