Is there any way to create bogus Predicate in JPA? Sort of like this:
CriteriaBuilder cb = em.getCriteriaBuilder;
Predicate pred = cb.isTrue(false);
Almost all the methods of CriteriaBuilder take Expression as parameter. I also tried this to no avail:
Expression<Object> path = cb.coalesce.value(null);
Predicate pred = cb.isNotNull(path);
Obviously it throws NPE, however I thought that this might work, because according to API documentation:
A coalesce expression is equivalent to a case expression that returns null if all its arguments evaluate to null, and the value of its first non-null argument otherwise.