You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My model has a bidirectional OneToMany / ManyToOne relationship: Each Link (between two NetPoints) has a list of GPSPoints. The foreign key consists of multiple fields (Embeddable).
When I use the Link.findAll().list() method, I get an exception:
java.lang.ClassCastException: class org.hibernate.sql.results.graph.embeddable.internal.EmbeddableInitializerImpl cannot be cast to class org.hibernate.reactive.sql.results.graph.ReactiveInitializer (org.hibernate.sql.results.graph.embeddable.internal.EmbeddableInitializerImpl and org.hibernate.reactive.sql.results.graph.ReactiveInitializer are in unnamed module of loader io.quarkus.bootstrap.classloading.QuarkusClassLoader
Link.<Link>findById(key) works.
Am I doing something wrong or is this a bug? I have not used Hibernate much before.
Expected behavior
My test case, where I call Link.findAll().list(), should work.
ivu-mawi
changed the title
ClassCastException when using a mapping with composite (embeddable) foreign key
Hibernate Reactive: ClassCastException when using a mapping with composite (embeddable) foreign key
May 23, 2025
Describe the bug
I seem to be having an issue similar to this one.
My model has a bidirectional OneToMany / ManyToOne relationship: Each
Link
(between twoNetPoint
s) has a list ofGPSPoint
s. The foreign key consists of multiple fields (Embeddable).When I use the
Link.findAll().list()
method, I get an exception:Link.<Link>findById(key)
works.Am I doing something wrong or is this a bug? I have not used Hibernate much before.
Expected behavior
My test case, where I call Link.findAll().list(), should work.
Actual behavior
The test fails with a ClassCastException.
How to Reproduce?
I have pushed my minimal example reproducer here:
https://github.com/ivu-mawi/hibernate-reactive-bug
You can see the failing test output in the CI as well. This one works. This one fails.
Output of
uname -a
orver
No response
Output of
java -version
Temurin-21.0.7+6
Quarkus version or git rev
3.22.3
Build tool (ie. output of
mvnw --version
orgradlew --version
)3.9.9
Additional information
No response
The text was updated successfully, but these errors were encountered: