-->
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 f
PostPosted: Sun Jul 16, 2006 9:13 pm 
Beginner
Beginner

Joined: Wed Aug 10, 2005 12:09 am
Posts: 30
Hibernate version: 3.1.3

Mapping documents:
<?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 16, 2006 3:17:58 PM by Hibernate Tools 3.1.0.beta5 -->
<hibernate-mapping>
<class name="au.edu.nsw.det.csa.eat.uni.datatypes.UniCourse"
table="UNI_COURSE" mutable="false">
<composite-id name="id" class="au.edu.nsw.det.csa.eat.uni.datatypes.UniCourseId">
<key-property name="uniCode" type="string">
<column name="UNI_CODE" length="10" />
</key-property>
<key-property name="courseCode" type="string">
<column name="COURSE_CODE" length="10" />
</key-property>
</composite-id>
<version name="transactionId" type="integer" unsaved-value="null">
<column name="TRANSACTION_ID" precision="8" scale="0"/>
</version>
<many-to-one name="uni" class="au.edu.nsw.det.csa.eat.uni.datatypes.Uni" update="false" insert="false" fetch="select">
<column name="UNI_CODE" not-null="true" />
</many-to-one>
<property name="description" type="string">
<column name="DESCRIPTION" length="60" not-null="true"/>
</property>
<set name="uniUnits" table="UNI_COURSE_UNIT">
<key>
<column name="UNI_CODE"/>
<column name="COURSE_CODE"/>
</key>
<many-to-many unique="true" class="au.edu.nsw.det.csa.eat.uni.datatypes.UniUnit">
<column name="UNI_CODE"/>
<column name="UNIT_CODE"/>
</many-to-many>
</set>
</class>

<?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 16, 2006 3:17:58 PM by Hibernate Tools 3.1.0.beta5 -->
<hibernate-mapping>
<class name="au.edu.nsw.det.csa.eat.uni.datatypes.UniUnit" table="UNI_UNIT">
<composite-id name="id" class="au.edu.nsw.det.csa.eat.uni.datatypes.UniUnitId">
<key-property name="uniCode" type="string">
<column name="UNI_CODE" length="10" />
</key-property>
<key-property name="unitCode" type="string">
<column name="UNIT_CODE" length="10" />
</key-property>
</composite-id>
<version name="transactionId" type="integer" unsaved-value="null">
<column name="TRANSACTION_ID" precision="8" scale="0"/>
</version>
<many-to-one name="uni" class="au.edu.nsw.det.csa.eat.uni.datatypes.Uni" update="false" insert="false" fetch="select">
<column name="UNI_CODE" not-null="true"/>
</many-to-one>
<property name="description" type="string">
<column name="DESCRIPTION" length="40" />
</property>
<property name="weighting" type="big_decimal">
<column name="WEIGHTING" precision="2" scale="1" />
</property>
<set name="assessmentCategories" inverse="true" table="ASSESSMENT_CATEGORY_UNIT">
<key>
<column name="UNI_CODE" not-null="true"/>
<column name="UNIT_CODE" not-null="true"/>
</key>
<many-to-many unique="true" class="au.edu.nsw.det.csa.eat.assessment.datatypes.AssessmentCategory">
<column name="ASSESSMENT_CATEGORY_ID" not-null="true"/>
</many-to-many>
</set>
<join table="UNI_COURSE_UNIT" inverse="true" optional="true">
<key>
<column name="UNI_CODE"/>
<column name="UNIT_CODE"/>
</key>
<many-to-one name="uniCourse" not-null="true" insert="false" update="false">
<column name="UNI_CODE" not-null="true"/>
<column name="COURSE_CODE" not-null="true"/>
</many-to-one>
</join>
</class>
</hibernate-mapping>

Full stack trace of any exception that occurs:
ERROR [hibernate.HibernateUtil] - Error configuring Hibernate SessionFactory specified by resource eat.hibernate.cfg.xml

org.hibernate.MappingException: Repeated column in mapping for collection: au.edu.nsw.det.csa.eat.uni.datatypes.UniCourse.uniUnits column: UNI_CODE

at org.hibernate.mapping.Collection.checkColumnDuplication(Collection.java:290)

at org.hibernate.mapping.Collection.checkColumnDuplication(Collection.java:313)

at org.hibernate.mapping.Collection.validate(Collection.java:270)

at org.hibernate.mapping.Set.validate(Set.java:19)

at org.hibernate.cfg.Configuration.validate(Configuration.java:988)

at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1169)

at au.edu.nsw.det.jet.hibernate.HibernateUtil.buildSessionFactory(HibernateUtil.java:56)

at au.edu.nsw.det.jet.hibernate.servlets.HibernateInitServlet.generateHibernateConfig(HibernateInitServlet.java:217)

at au.edu.nsw.det.jet.hibernate.servlets.HibernateInitServlet.init(HibernateInitServlet.java:148)

at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2141)

at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4582)

at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4676)

at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:820)

at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:542)

at com.evermind.server.Application.getHttpApplication(Application.java:889)

at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:707)

at com.evermind.server.http.HttpSite.getApplication(HttpSite.java:426)

at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:430)

at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:278)

at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:120)

at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)

at java.lang.Thread.run(Thread.java:534)

Name and version of the database you are using: Oracle9i


Is this a bug reported as

http://opensource.atlassian.com/projects/hibernate/browse/HHH-1338


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.