-->
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.  [ 3 posts ] 
Author Message
 Post subject: Mapping error
PostPosted: Fri Jun 10, 2005 4:01 am 
Regular
Regular

Joined: Wed Sep 22, 2004 8:27 am
Posts: 89
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.05

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">
<hibernate-mapping>

<class name="com.coginfo.kf.bean.RelazioneParametro" table="KFT_RELAZIONI_PARAMETRI" select-before-update="true">
<meta attribute="class-description">Parametro</meta>
<composite-id name="id" class="com.coginfo.kf.bean.ParametroPk">
<key-many-to-one name="codintpar" class="com.coginfo.kf.bean.Parametro">
<column name="codintrep"/>
<column name="codintpar"/>
</key-many-to-one>
<key-many-to-one name="codintmod" class="com.coginfo.kf.bean.Modalita">
<column name="codintdmn"/>
<column name="codintmod"/>
</key-many-to-one>
</composite-id>

<many-to-one class="com.coginfo.kf.bean.Parametro" name="codintparpdr" not-null="true" lazy="true">
<column name="codintrep"/>
<column name="codintparpdr"/>
</many-to-one>

<property name="camporel" type="string">
<column name="camporel" length="100" sql-type="string" not-null="true"/>
</property>

<property name="logoper" type="string">
<column name="logoper" length="3" sql-type="string" not-null="true"/>
</property>

</class>

</hibernate-mapping>

Full stack trace of any exception that occurs:
org.hibernate.MappingException: Repeated column in mapping for entity: com.coginfo.kf.bean.RelazioneParametro column: codintrep (should be mapped with insert="false" update="false")

Name and version of the database you are using:
Oracle 9i

How is the correct mapping for this table? i've 2 columns that are two many-to-one with the same column codintparpdr...


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 10, 2005 4:47 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
read the exception and map it as such.

Only one of the associations can be used as the "master" of the column.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 14, 2005 2:33 pm 
Regular
Regular

Joined: Wed Sep 22, 2004 8:27 am
Posts: 89
ok.. but whitch is the solution?


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

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.