-->
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: One To Many Relationship and NHibernate.PropertyAccessExcept
PostPosted: Tue Sep 27, 2005 5:13 pm 
Newbie

Joined: Tue Sep 27, 2005 5:05 pm
Posts: 1
Location: Canada
I am very new to NHibernate/C#.. I have worked with Hibernate (java) before so I am thinking they work the same way....
However I am getting the NHibernate.PropertyAccessException that has some other additional Information that says "The type 'NHibernate.Collection.Set can not be assigned to a property of type System.Collection.IList'

So I have two Objects... Customers and Orders( right out of the NorthWind database)... I customer can have 1-* orders and the HBM files says that.

This error occurs when I query to get all the Customers and there realted Orders.... And I think that the error occurs when the framework tries to Create the Order Objects...

Also does anyone know how to enable the printStackTrace() (I dont know exactly what it is called in C# but in java its called printStackTrace()).... I was able to get the stack Trace with the older version of NHibernate but it has stopped appearing with the RC2 that I am using now...

My Envoirnment is
NHibernate version 1.0 RC2 (the latest)
.Net Framework 1.1

Anyone have any ideas what might be going on?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 28, 2005 7:14 am 
Senior
Senior

Joined: Wed Jun 15, 2005 4:17 am
Posts: 156
if you declared your list as System.Collection.IList you should map it as a bag not as a set. If you still need to use the set, the Nhibernate docs state that your collection (set in fact) is to be of type Iesi.Collections.ISet.

It is unavoidable, read the docs! Collection mapping is in Chapter 5.

Regards,
Radu


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.