Hi,
We are trying to migrate to Hibernate 6.5 and have done the necessary code changes.
We are currently still using the hbm.xml files itself and have not moved to annotated class files.
Here is the hbm.xml file currently being used -
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class entity-name="artist" lazy="true" name="orm.artist" table="ARTISTS">
<id name="id" type="int">
<column length="10" name="ARTISTID"/>
<generator class="increment"/>
</id>
<property name="firstname" type="string">
<column name="FIRSTNAME"/>
</property>
<property name="lastname" type="string">
<column name="LASTNAME"/>
</property>
</class>
</hibernate-mapping>
We were trying to run a basic testcase where we are just trying to insert a new record to the table. But we are getting this exception right now -
org.hibernate.MappingException: entity class not found: orm.artist
at org.hibernate.mapping.PersistentClass.getMappedClass(PersistentClass.java:179)
at org.hibernate.jpa.event.internal.CallbacksFactory.buildCallbackRegistry(CallbacksFactory.java:48)
at org.hibernate.event.spi.EventEngine.<init>(EventEngine.java:44)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:457)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:997)
If we run the same exact code using the older version of Hibernate (5.6.15) then its working and we dont see any errors.
Looking at the exception, it looks like there is an expectation for an entity class file but we are not using those right now. Is it mandatory to be using them with Hibernate 6 ?
If not , is there a setting to be enabled which can bypass this requirement?