-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SELECT ID(entityvar) only returns part of IdClass #2211
Comments
I am looking into this issue |
visit(IdExpression) should probably be updated; one may want to be checking also |
probably a problem on line 66 there |
Thanks Lukas. Will look into this |
A few hints about this issue:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following JPQL,
is used on an entity,
with an IdClass
The result ought to be a list of CityId.
Instead, it returns a list of String where the values are the
stateName
entity attribute, which is only one of the two components of the ID.It looks like the same error occurs with the ID() function regardless of whether the entity identification variable is
THIS
or something else. I tried withSELECT ID(o) FROM City o
and saw the same result.It should be noted that section 4.7.11 of the Jakarta Persistence 3.2 specification states that, "A persistence provider is not required to support the use of the ID function for entities with composite primary keys." That means EclipseLink would have the option of raising an error and declaring the
ID()
function to be unsupported when IdClass is used. However, that is not what is happening here either. It is clearly trying to support the function, but returning the wrong value--only part of the composite primary key rather than the IdClass value that is the entire primary key.The text was updated successfully, but these errors were encountered: