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
|