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
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