-->
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.  [ 6 posts ] 
Author Message
 Post subject: <array> and <many-to-many> error
PostPosted: Sun Jun 05, 2005 9:35 am 
If I want to have an IList interface on an object property, the mapping needs and <array>. But, the <many-to-many> withing the array produces errors.

hbm.xml fragment:
<array name="Friends" table="Friends" >
<key column="Person_ID"/>
<many-to-many column="Friend_ID" class="HibernateTest.Person, HibernateTest" />
</array>

Error:
The element <array> has invalid child element: <many-to-many>.

The documentation even has an example how an array can have many-to-many. (http://nhibernate.sourceforge.net/h2.0. ... tions.html)

What am I doing wrong here?


Top
  
 
 Post subject:
PostPosted: Sun Jun 05, 2005 3:50 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
This is apparently an omission in the XML schema, need to fix it...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 06, 2005 2:40 am 
Can I fix it myself? Just point me in the right directon...

Thanks,
Miha.


Top
  
 
 Post subject:
PostPosted: Mon Jun 06, 2005 2:04 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Hmm, I've looked at the mapping XSD now, and many-to-many is there, but the schema expects the array to contain <key>, then <index>, and then a <many-to-many> or something else, in that order. So the problem is actually the missing <index>.


Top
 Profile  
 
 Post subject: Missing index?
PostPosted: Mon Jun 06, 2005 6:14 pm 
I don't have an index in that table. It is just a mapping table (association table, to be exact).

Can't I use Array in that case? I just want to use IList interface... :)

Miha


Top
  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 12:27 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Then you should probably use a <bag>, it maps to an IList.


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