Hi,
I'm creating a 1-to-1 association with Hibernate using unique foreign key associations. My two objects are User and Login.
But I encountered the following errors:
[
java] net.sf.hibernate.MappingException: An association from the table USER refers to an unmapped class: com.finport.user.Login
[java] at net.sf.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configuration.java:687)
[java] at net.sf.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:671)
[java] at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:789)
[java] at CreateTest.main(CreateTest.java:11)
[java] Exception in
thread "main"
[java] Java Result: 1
The following are excerpts from both classes mapping files:
User.hbm.xml
=========================
<many-to-one
name="login"
class="com.finport.user.Login"
cascade="all"
outer-join="auto"
update="true"
insert="true"
access="property"
column="LOGINID"
unique="true"
/>
Login.hbm.xml
=========================
<one-to-one
name="user"
class="com.finport.user.User"
cascade="none"
outer-join="auto"
constrained="false"
property-ref="login"
/>
Does anyone have any idea what went wrong? Thanks in advance for your help.