Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » JPQL Error: collection-valued path '...' cannot be resolved to a valid association field(Defining a NamedQuery, the Validator signals me an Error but the query works well ...)
JPQL Error: collection-valued path '...' cannot be resolved to a valid association field [message #1814032] Mon, 02 September 2019 07:29
Kim Sönksen is currently offline Kim SönksenFriend
Messages: 1
Registered: September 2019
Junior Member
I have an Entity named Person which as the following property:

@ElementCollection(targetClass = Role.class, fetch = FetchType.EAGER)
@Enumerated(EnumType.STRING)
@CollectionTable(name = "person_roles")
private Set<Role> roles = new HashSet<>();


and I have a NamedQuery whis looks like this:

@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 Query works well and as expected, but the Validator in the UI always tells me

The collection-valued path 'a.roles' cannot be resolved to a valid association field.


Does someone know how to get around this annoying behaviour without completely disabling the validation?

Thnx in advance.
Previous Topic:Integer instead of int
Next Topic:Cannot generate entities from existing MySQL db using JPA Tools
Goto Forum:
  


Current Time: Wed Apr 24 22:35:36 GMT 2024

Powered by FUDForum. Page generated in 0.03024 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top