I have an entity that has a list of enitities connected to it. Customer.roles = List<Role>()
Now I get roleId
as input and I'd like to know if customer has the role connected to it.
I've tried several Ways using CriteriaQuery
but haven't yet found the right way. How to do this using CriteriaQuery
.
Idealy I'd like something like:
fromCustomer.get("roles").has(roleId)