Joined: Wed Jan 11, 2006 12:59 pm Posts: 11
|
I am having trouble mapping two classes to a legacy DB. The mappings and stack trace are below. I must be doing something wrong with the key-many-to-one elements found in the composite-id, but I don't understand what the message "An association from the table CLMAST refers to an unmapped class: java.lang.String" means. Any help would be appreciated.
Hibernate version: 3.0
Mapping documents:
<class name="ClaimMaster" table="CLMAST" schema="fbmtstdta" catalog="FBMAS270">
<composite-id name="clKey" class="ClaimMasterKey">
<key-many-to-one name="company" column="CMTCO" />
<key-many-to-one name="policy" column="CMTPOL" />
<key-many-to-one name="suffix" column="CMTSFX" />
<key-property name="lossDate" column="CMTLDT" />
<key-property name="sequence" column="CMTSEQ" />
</composite-id>
<property
name="insuredHomePhone"
column="CMTIHP"
type="long"
/>
<many-to-one name="insMaster" class="InsuranceMaster" ></many-to-one>
</class>
<class name="InsuranceMaster" table="INMAST" schema="fbmtstdta" catalog="FBMAS270">
<composite-id name="inKey" class="InsuranceMasterKey">
<key-property name="company" column="INMCMPY" type="string"/>
<key-property name="policy" column="INMPRFX" type="string"/>
<key-property name="suffix" column="INMSUFX" type="string"/>
</composite-id>
<property
name="fedSuffix"
column="INMFEDSX"
type="long"
/>
</class>
Full stack trace of any exception that occurs:
%%%% Error Creating SessionFactory %%%%
org.hibernate.MappingException: An association from the table CLMAST refers to an unmapped class: java.lang.String
at org.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configuration.java:968)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:921)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:999)
at com.idfbins.adp.SessionFactory.currentSession(SessionFactory.java:49)
at com.idfbins.adp.MyTest.main(MyTest.java:18)
Exception in thread "main" java.lang.NullPointerException
at com.idfbins.adp.MyTest.main(MyTest.java:19)
|
|