ClassCastException
when retrieving composite table entity with @IdClass
#2004
Milestone
ClassCastException
when retrieving composite table entity with @IdClass
#2004
When I retrieve an entity that models a composite table/relationship between two other tables and uses an
@IdClass
to implement the composite primary key, the query fails with aClassCastException
. This issue is similar to the failure reported in #1979 (which I also commented on), but not resolved by2.4.1.Final
.As an example, I use the following (abbreviated) entities:
The entities are connected via the following composite table which uses an
@IdClass
:The
EntityA
andEntityB
class can be persisted without issues. TheRelationship
class, can be persisted, but not retrieved. When performing a query such asthe following exception is thrown:
When using Hibernate Reactive
2.3.1.Final
, the entities can be retrieved. In2.4.0.Final
and2.4.1.Final
, the exception occurs. Based on the previous ticket, I created the following reproducer of the entities shown above that demonstrates the issue:hibernate-reactive-idclass-issue.zip
You can execute it with
./gradlew run
. If you want to inspect the behaviour in the previous version, you can adjust theext
block in thebuild.gradle
.Best regards,
Janek
The text was updated successfully, but these errors were encountered: