i cannot map these 2 tables (* indicate primary key)
TABLE COMTB00F (Cities, Parent)
CMKEY*
CMDTDA*
CMDESC
CMPRV
CMCAP
TABLE CAPTB00F (Child)
CAPCCOM*
CAPKEY*
CAPINAIL
the relation should be between CMKEY and CAPCCOM; i need to load for each CMKEY|CMDTDA record, a list of possible CAP records
with the following mapping files i get an error because the foreign key differs from parent key
Hibernate version: 1.2.0 alpha 1
Mapping documents:
TABLE COMTB00F (Cities, Parent)
<?xml version='1.0' encoding='utf-8'?>
<hibernate-mapping xmlns='urn:nhibernate-mapping-2.0'>
<class name='CUP.Cities, CUP' table='COMTB00F'>
<composite-id>
<key-property name='ID' column='CMKEY' />
<key-property name='StartValidity' column='CMDTDA' />
</composite-id>
<property name='Description' column='CMDESC' />
<property name='State' column='CMPRV' />
<property name='Postal' column='CMCAP' />
<bag name='CAPs' table ='CAPTB00F'>
<key>
<column name ='CAPCCOM'/>
</key>
<one-to-many class ='CUP.CAP, CUP'/>
</bag>
</class>
</hibernate-mapping>
TABLE CAPTB00F (Child)
<?xml version='1.0' encoding='utf-8'?>
<hibernate-mapping xmlns='urn:nhibernate-mapping-2.0'>
<class name='CUP.CAP, CUP' table='CAPTB00F'>
<composite-id>
<key-property name='CityID' column='CAPCCOM' />
<key-property name='ID' column='CAPKEY' />
</composite-id>
<property name='INAIL' column='CAPINAIL' />
</class>
</hibernate-mapping>
Name and version of the database you are using: Oracle 10g
|