-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: org.hibernate.MappingException: Repeated column in mapping
PostPosted: Tue Feb 15, 2011 6:52 am 
Newbie

Joined: Wed Feb 09, 2011 8:26 am
Posts: 4
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.