-->
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: Repeated column in mapping for collection error
PostPosted: Fri Aug 05, 2005 1:26 pm 
Using the following mapping file, I get the following error:

DomainModelSpike.ItemDbTests.TestGetItems : NHibernate.MappingException : Repeated column in mapping for collection: DomainModelSpike.Supplier.Items column: site_id
TearDown : System.NullReferenceException : Object reference not set to an instance of an object.

Why can't site_id exist for both key and the many to many column mappings?

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="DomainModelSpike.Supplier, DomainModelSpike" table="Supplier">
<composite-id>
<key-property name="SiteId" column="site_id" />
<key-property name="Id" column="supplier_id" />
</composite-id>


<set name="Items" lazy="true" table="ItemSupplier" >
<key>
<column name="site_id"/>
<column name="supplier_id"/>
</key>
<many-to-many class="DomainModelSpike.Item, DomainModelSpike">
<column name="site_id"/>
<column name="item_id"/>
</many-to-many>
</set>
</class>
</hibernate-mapping>

Any help that anybody could provide would be appreciated.


Top
  
 
 Post subject: Did you find a way to solve this?
PostPosted: Thu Dec 08, 2005 4:35 am 
Newbie

Joined: Mon Dec 05, 2005 10:02 am
Posts: 12
I'm having the same problem now.
Please let me know if you managed to work out the problem.

Thanks


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.