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: [xml parsing error] fichier de mapping
PostPosted: Wed Nov 22, 2006 12:19 pm 
Newbie

Joined: Wed Oct 11, 2006 11:32 am
Posts: 18
Bonjour,

je debute sur hibernate et je teste les associations one-to-many, many-to-many...
J'ai d'ores et deja reussi a faire des operations simple sur une table et j'aimerais maintenant associer des collections d'objets via des associations vers d'autres tables.

Mais j'obtiens une erreur :
Quote:
[...]
Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from resource com/presentation/hibernate/demo/generated/VarReportSetup.hbm.xml
[...]
Caused by: org.xml.sax.SAXParseException: Attribute "name" must be declared for element type "many-to-many".

Voici la partie interessante du fichier VarReportSetup.hbm.xml :
Code:
       <set name="filterCollection" table="VarReportFilter">
           <key column="VarReportSetupId"/>
           <many-to-many name="filter" column="Id" class="VarReportFilter"/>
       </set>

...et une partie du fichier de mapping de VarReportFilter :
Code:
      <id name="Id" type="binary">
           <generator class="com.reuters.kgl.presentation.hibernate.demo.util.UUIDGenerator"/>
        </id>
      
      <property
         name="VarReportSetupId"
         column="VarReportSetupId"
         type="binary"
         not-null="true"
         length="12"
      />

Ce que je ne comprends pas c'est que l'attribut name ne semble pas etre obligatoire a en croire la documentation d'hibernate
Avez vous une idee ?

Merci beaucoup :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 28, 2006 10:47 am 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
Il faut comprendre le message dans l'autre sens : la balise many-to-many ne possède pas d'attribut name

_________________
Seb
(Please don't forget to give credits if you found this answer useful :)


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.