-->
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: Beginner : Many to Many using MAP and IDictionary
PostPosted: Tue Feb 20, 2007 5:22 am 
Newbie

Joined: Mon Feb 19, 2007 8:47 am
Posts: 1
Hi

I am trying to map to classes together using a many to many link.

I have no problem joining the two classes together when using the <bag> tag. However when I map the two classes together using the <map> tag as I want to use and Idictionary and run into a mapping error 'Repeated column in mapping for collection'

Is it possible to set nHibernate up so that the many-to-many will create a IDictionary list in the same way it would for a one-to-many

My current mapping file

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="ClassLibrary1.ClassA, ClassLibrary1" table="ClassA">
<id name="Id" column="Id" unsaved-value="00000000-0000-0000-0000-000000000000" access="field.camelcase">
<generator class="NHibernate.Id.GuidGenerator" />
</id>
<property name="Description" column="Description" access="field.camelcase" type="String" />
<map name="ClassBs" table="ClassAClassB" cascade="none" lazy="true" access="field.camelcase">
<key column="ClassAId"/>
<index column="ClassBId" type="Guid"/>
<many-to-many class="ClassLibrary1.ClassB, ClassLibrary1" column="ClassBId" />
</map>
</class>
</hibernate-mapping>

Regards

Richard


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.