I would like to do this but with the criteria API instead:
select count(distinct e) from Event e, IN(e.userAccessPermissions) p where p.principal = :principal and p.permission in (:permissions)
Any ideas?
You can use countDistinct on CriteriaBuilder
criteriaQuery.select(criteriaBuilder.countDistinct(entityRoot))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With