I am currently migrating an older application from hbm mappings to annotations. I have read numerous places stating that it is possible to do this, including the hibernate docs. I am running into trouble when I try to reference an annotated class from an hbm mapped with a many-to-one relationship.
I am getting the following error complaining about the annotated class.
“nested exception is org.hibernate.MappingException: Association references unmapped class: …cepis.domain.Note”
Is it possible to achieve what I want here, is there something very basic that I am missing (note like I said I have read numerous times that it is possible so a simple “yes it is possible” will not be of much help)?
My session factory is defined as follows …
<bean id="sessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"
scope="singleton">
<property name="dataSource" ref="itc5DataSource" />
<property name="mappingResources">
<list>
<value>edu/uky/cepis/User.hbm.xml</value>...
</list>
</property>
<property name="annotatedClasses">
<list>
<value>edu.uky.cepis.domain.Note</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${itc5.dialect}</prop>
...
</props>
</property>
</bean>
Thank you so much for any help in advance!
have you tried setting _ hibernate.mapping.precedence_ to “class, hbm”?