Property paths for associations that are part of the entity ID (i.e. IdClass) are not initialized

Description

I have found an issue when trying to query an embedded identifier property from an association that is mapped as an identifier of an entity that uses IdClass.

Given the following domain:

The test:

will fail with:

Because idClassEntity.basicEntity.key1 is not added as property path in the BasicEntityPropertyMapping. This is because idClassEntity.basicEntity is treated as a basic type rather than an association type. This is most likely caused by the handling of attributes that are derived from @IdClass attributes in the metamodel, as reported in HHH-12969, although it might be possible to work around the issue without solving (which would probably require some bigger rework of the IdClass related code).

Activity

Steve EbersoleNovember 19, 2024 at 10:25 PM

I wrote some simple tests in main (7.0) based on your description and this, along with https://hibernate.atlassian.net/browse/HHH-12969 , works there.

Out of Date

Details

Assignee

Reporter

Priority

Created September 27, 2018 at 4:46 PM
Updated December 3, 2024 at 9:20 AM
Resolved November 19, 2024 at 10:25 PM