@ElementCollection(targetClass = Role.class, fetch = FetchType.EAGER) @Enumerated(EnumType.STRING) @CollectionTable(name = "person_roles") private Set<Role> roles = new HashSet<>();
@NamedQuery( name = Person.NQ_GET_PERSON_BY_ROLE_ENTITY, query = "select a from Person a, IN(a.roles) r where r = :role and a.legalEntity = :legalEntity "
The collection-valued path 'a.roles' cannot be resolved to a valid association field.