-->
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.  [ 2 posts ] 
Author Message
 Post subject: Repeated column in mapping for entity
PostPosted: Fri Aug 12, 2005 8:45 am 
Beginner
Beginner

Joined: Thu Aug 11, 2005 11:16 am
Posts: 20
Bonjour ,

J'ai l'erreur suivante :
org.hibernate.MappingException: Repeated column in mapping for entity: model.Child_TC column: ac_id (should be mapped with insert="false" update="false")
at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:504)
at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:542)


Je pense que c'est du faite que je veux mettre en PrimaryKey/ForignKey dans la table Child_Tc deux attribut childtc et fathertc qui sont tout 2 des FK de ac_id identifiant de la table AC, donc il y a une repetition de colonne mais c'est normal je veux faire en sql :

CREATE TABLE CHILDTC(child_tc_id integer NOT NULL,
father_tc_id integer NOT NULL,
channel_number integer,
constraint constcfchild foreign key(child_tc_id) references AC(ac_id),
constraint constcfkfather foreign key(father_tc_id) references AC(ac_id),
PRIMARY KEY (father_tc_id, child_tc_id)
);

le code de child_tc.hbm.xml est :

<hibernate-mapping>

<class name="model.Child_TC" table="CHILD_TC">

<composite-id name="compositeID" class=" model.Child_TC">
<key-many-to-one name="child_tc_id" class="model.AC" column="ac_id"
/>
<key-many-to-one name="father_tc_id" class="model.AC" column="ac_id"
/>
</composite-id>

<property name="channel_number" type="int">
<column name="channel_number" sql-type="int" not-null="true"/>
</property>

</class>

</hibernate-mapping>



Hibernate version: 3.0

Mapping documents: 3.0

Name and version of the database you are using: oracle 8.1

_________________
Cyril,


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 13, 2005 12:13 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Tu mélanges des notions
Code:
<composite-id name="compositeID" class=" model.Child_TC">
<key-many-to-one name="childTc" class="model.AC" column="child_tc_id"
/>
<key-many-to-one name="fatherTc" class="model.AC" column="father_tc_id"
/>
</composite-id>

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.