-->
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: problème avec composite-id
PostPosted: Thu May 07, 2009 5:40 am 
Newbie

Joined: Thu May 07, 2009 5:33 am
Posts: 1
Bonjour,

j'ai utilisé une relation intermédiare pour fair le mapping many-to-many
voici mon bout de code pour le mapping de la classe intermédiare:

<composite-id name="id" unsaved-value="any" class="Base.TransaDocument">

<key-property name="iddoc" access="field" column="IDDOC" />

<key-property name="idtransaction" access="field" column="IDTRANSACTION" />
</composite-id>

Mais quand je compile j'ai cette erreur:


Caused by: org.hibernate.MappingException: Foreign key (FKFBA4ED49015EE94:TRANSADOCUMENT [IDTRANSACTION])) must have same number of columns as the referenced primary key (TRANSADOCUMENT [IDDOC,IDTRANSACTION])
at org.hibernate.mapping.ForeignKey.alignColumns(ForeignKey.java:90)
at org.hibernate.mapping.ForeignKey.alignColumns(ForeignKey.java:73)
at org.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configuration.java:1263)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1170)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:324)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1286)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)
at Base.HibernateUtil.<clinit>(HibernateUtil.java:28)
... 2 more

Merci pour otre aide je me bloque là et je devrais passer


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.