How can I express literal true
and literal false
in JPA's Criteria API?
I'm looking for something like Predicate alwaysTrue = CriterialBuilder.DefaultLiterals.TRUE
(analogous to java.lang.Boolean.TRUE
).
To get an always true Predicate
instance, use criteriaBuilder.and()
.
To get an always false Predicate
instance, use criteriaBuilder.or()
.