Hello I have a mapping file that says
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
<class name="uk.ac.sheffield.cics.pbscas.model.SuCasQualification" table="SU_CAS_QUALIFICATIONS" schema="PBSCAS">
<id name="qualId" type="java.lang.Long" column ="QUALIFICATION_ID">
<generator class="native" />
</id>
<property name="evidenceToObtainOffer" type="java.lang.String">
<column name="EVIDENCE_TO_OBTAIN_OFFER" length="2000" />
</property>
<property name="includeInXml" type="java.lang.String">
<column name="INCLUDE_IN_XML" length="1" />
</property>
<join table="PBSCAS.SU_CAS_QUALIFICATION_DOCS" optional="true">
<key column="QUALIFICATION_ID" unique="true" />
<many-to-one name="suCasQualificationDocument" column="DOCUMENT_ID" />
</join>
</class>
</hibernate-mapping>
and this seems to be generating the error
org.hibernate.MappingException: Repeated column in mapping for entity: uk.ac.sheffield.cics.pbscas.model.SuCasQualification column: QUALIFICATION_ID (should be mapped with insert="false" update="false")
Now looking at 7.3.2. Many-to-one at
http://docs.jboss.org/hibernate/core/3. ... l-join-m21, the example cas a duplicate personId colum.
I can't add insert="false" update="false" in the key column as the schema does not support it.
Does hibernate not understand that the duplicate column name is in another table?
Cheers for any advice