composite id's defined via hbm.xml cause java.lang.IllegalArgumentException in JPA deployment

Description

When defining a composite ID using hbm.xml in a JPA deployment, defining <composite-id class="com.acme.CustomerInventoryPK" mapped="true"> causes an "java.lang.IllegalArgumentException: expecting IdClass mapping" Exception to be thrown

Please see forum discussion:

https://forum.hibernate.org/viewtopic.php?f=1&t=1030434

Activity

Show:

Christian Beikov January 20, 2025 at 3:32 PM

This should be fixed in ORM 6+.

Nitin Kadam January 9, 2022 at 5:13 PM

We have migrated from Hibernate 3 to Hibernate 5.3.2 and we are now stuck with this issue. As a work-around using mixed approach of annotation + HBM file is out of scope as it will call for lot of changes.

Is this issue going to be fixed. This seems to be un-assigned to anyone 😞

Former user May 8, 2018 at 12:38 AM

Kirill M September 19, 2017 at 4:19 PM

I've reproduced this issue with Hibernate 5.2.11.Final. I've made a minimal reproduction here: https://github.com/kmorozov/hibernate-id-class-test-case.
It does not look like I can edit the issue here. Can someone update the version information and such?

Steve Ebersole October 28, 2015 at 3:26 AM

As part of verifying that this issue affects 5.0, please just set the "Affects version". Leave the "verify-affects-5.0" label and leave the issue in "Awaiting Response" status; these are critical for us to be able to track these verifications and triage them. Thanks.

Out of Date

Assignee

Unassigned

Reporter

Components

Affects versions

Priority

Created January 10, 2014 at 1:49 PM
Updated January 20, 2025 at 3:32 PM
Resolved January 20, 2025 at 3:32 PM