I am trying to write a Select
statement using JPA 2
provided CriteriaQuery
for the following scenario:
- Group items and if at least one of the columns is 'true', return true
- Group items and if all columns are 'true', return true
I noticed there is bool_and
and bool_or functions
in PostGreSQl
. Here is a link that explains these functions.
boolean aggregate functions
How do I achieve this functionality using JPA CriteriaQuery/CriteriaBuilder?