Hibernate-Version: 3.2.4.sp1
We are currently using composite-keys for all of our tables.
Below are the mapping files for a parent-child one-to-many association:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Jun 20, 2008 12:44:28 PM by Hibernate Tools 3.2.0.b9 -->
<hibernate-mapping>
<class name="com.expd.app.edms.domain.hiber.MasterDeliveryOrderData" table="MASTER_DELIVERY_ORDER">
<meta attribute="implements" inherit="false">com.expd.app.edms.data.IMasterDeliveryOrderData</meta>
<composite-id name="id" class="com.expd.app.edms.domain.hiber.EdmsPrimaryKey">
<key-property name="oid" type="big_decimal">
<column name="OID" scale="0" />
</key-property>
<key-property name="branch" type="string">
<column name="BRANCH" length="3" />
</key-property>
</composite-id>
<timestamp name="lastUpd" column="LAST_UPD" />
<set name="addressAssocDatas" inverse="true" fetch="subselect">
<key>
<column name="OWNER_MSTR_DELIVERY_ORDER_OID" scale="0" />
<column name="BRANCH" length="3" not-null="true" />
</key>
<one-to-many class="com.expd.app.edms.domain.hiber.AddressAssocData" />
</set>
</class>
</hibernate-mapping>
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Jun 20, 2008 12:44:28 PM by Hibernate Tools 3.2.0.b9 -->
<hibernate-mapping>
<class name="com.expd.app.edms.domain.hiber.AddressAssocData" table="ADDRESS_ASSOC">
<meta attribute="implements" inherit="false">com.expd.app.edms.data.IAddressAssocData</meta>
<composite-id name="id" class="com.expd.app.edms.domain.hiber.EdmsPrimaryKey">
<key-property name="oid" type="big_decimal">
<column name="OID" scale="0" />
</key-property>
<key-property name="branch" type="string">
<column name="BRANCH" length="3" />
</key-property>
</composite-id>
<timestamp name="lastUpd" column="LAST_UPD" />
<many-to-one name="masterDeliveryOrderData" class="com.expd.app.edms.domain.hiber.MasterDeliveryOrderData" fetch="select">
<column name="OWNER_MSTR_DELIVERY_ORDER_OID" scale="0" />
<column name="BRANCH" length="3"/>
</many-to-one>
</class>
</hibernate-mapping>
We get the following error:
main app.edms.hiber.HibernateUtil - org.hibernate.MappingException: Repeated column in mapping for entity: com.expd.app.edms.domain.hiber.AddressAssocData column: BRANCH (should be mapped with insert="false" update="false")
Is there any way around this problem?
Thanks,
Debra Zarley
|