Entities with compound primary keys are not properly handled when querying metamodel and using Criteria API

Description

Suppose we have entity defined like this:

Then the following code will fail:

The same problems exists trying to query this entity:

See that attributes are accessed by name. In the first example IllegalArgumentException is thrown in second NPE

Environment

None

Activity

Show:
Jarek Lewandowski
February 18, 2011, 1:39 PM

One nasty workaround is to check : foo_.hasSingleIdAttribute() and get attributes from the set foo_.getIdClassAttributes()

Jarek Lewandowski
February 18, 2011, 1:41 PM

Of course there is missing @IdClass annotation in the example

Brett Meyer
March 7, 2014, 5:31 PM

Bulk closing rejected tickets in "resolved" state.

Assignee

Gail Badner

Reporter

Jarek Lewandowski

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major
Configure