-->
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: many-to-many and common foreign keys column
PostPosted: Tue Oct 04, 2005 2:20 pm 
Newbie

Joined: Wed May 25, 2005 8:28 am
Posts: 18
I'm declaring a set with fot many-to-may association with:

<set name="assuntos" table="apoloes.ProcessoAssuntoProcesso" lazy="true" order-by="NUMORD">
<key>
<column name="CODSECAO"/>
<column name="CODDOC"/>
</key>
<many-to-many class="br.gov.trf2.jfes.apolo.processo.AssuntoProcesso">
<column name="CODSECAO"/>
<column name="CODASSPROC"/>
</many-to-many>
</set>


As you can see, CODSECAO is a common column to tables Processo, AssuntoProcesso and ProcessoAssuntoProcesso.


the following exception occur

org.hibernate.MappingException: Repeated column in mapping for collection: br.gov.trf2.jfes.apolo.processo.Processo.assuntos column: CODSECAO

How can I make the mapping without errors?


Top
 Profile  
 
 Post subject: Tables
PostPosted: Tue Oct 04, 2005 2:21 pm 
Newbie

Joined: Wed May 25, 2005 8:28 am
Posts: 18
Processo
KEY [CODSECAO, CODDOC]


AssuntoProcesso
Key[CODSECAO, CODASSPROC]

ProcessoAssuntoProcesso (Associative Table)
Key[CODSECAO,CODDOC,CODASSPROC]


Top
 Profile  
 
 Post subject: Reply
PostPosted: Tue Oct 04, 2005 10:38 pm 
Newbie

Joined: Wed May 25, 2005 8:28 am
Posts: 18
Nobody had this problem and solved it?


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.