Exception when find by association id that is a generic @EmbeddedId with @MappedSuperclass

Description

I have the following abstracts base classes:

and the following concrete entities:

When I try to find invoices by customer id, I get the following exception:

I’ve debug as I could and AFAICS, as both concrete entities share the same superclass, there is only one MappedSuperclass instance and the DeclaredIdentifierProperty is being replaced with the id of the last entity. After, this id is used to validate the query parameter value and they are incompatibles.

There is a similar problem , although I’m not sure that is exactly the same.

Here is a test case demonstrating this issue in Hibernate 6 and here is a test case demonstrating the same code working in Hibernate 5

Activity

Show:

Francisco Sousa January 21, 2023 at 2:15 PM

I’ve updated issue to add test cases according to the sugested template.

Fixed

Details

Assignee

Reporter

Worked in

Fix versions

Priority

Created January 19, 2023 at 11:35 PM
Updated February 23, 2023 at 2:10 PM
Resolved January 26, 2023 at 12:52 PM