I upgraded my Spring Boot Application to version 3.0.2 and use Hibernate ORM 6.1.7.Final
Due to issues with “fetch” I wanted to try using ORM 6.2.0.Final to check if in this version our problems will go away but I even couldn’t start the app. I’m getting:
java.lang.ClassCastException:
class org.hibernate.mapping.BasicValue cannot be cast to class org.hibernate.mapping.ToOne (org.hibernate.mapping.BasicValue and org.hibernate.mapping.ToOne are in unnamed module of loader ‘app’)
and it complains about Hibernate Configuration class.
do I need to add any additional dependencies to my pom to be able to use it ?
right now I have :
Hello, this error looks very similar to [HHH-16437] - Hibernate JIRA, but without the full stack trace and the mapping that causes the problem I can’t be sure.
Please check my comment and that issue and verify if you’re using mappedBy correctly in your associations.
The field name itself is not the problem, is the type of the field referenced with mappedBy which has to be an Entity type to correctly define a bi-directional association, not a basic type (like Integer or id).
As I said, without seeing your mappings it’s hard to say. I suggest you to read through the issue I linked, including the reference to the User Guide which explains this in more detail.