-->
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.  [ 3 posts ] 
Author Message
 Post subject: Mapping exception
PostPosted: Mon Jul 09, 2007 5:57 pm 
Beginner
Beginner

Joined: Fri Jul 06, 2007 9:27 pm
Posts: 22
As part of learning NHibernate, I am writing a simple demo using a Customer - Order - OrderItem hierarchy. I'm using it to learn how to map collection properties. So, a Customer object has an Orders property, which is an IList<Order>. And an Order has an OrderItems property, which is an IList<OrderItem>.

Here is the mapping markup that I am using for the Customer.Orders property:

<!-- Mapped collection -->
<bag name="Orders" table="Orders" cascade="all">
<key column="CustomerID"/>
<one-to-many class="NHibernateDemo1.Order, NHibernateDemo1"/>
</bag>

And here is the mapping markup that I am using for the Order.OrderItems property:

<!-- Mapped collection -->
<bag name="OrderItems" cascade="all">
<key column="OrderID"/>
<one-to-many class="NHibernateDemo1.OrderItem, NHibernateDemo1"/>
</bag>

The cfg object initializes fine. But when I call cfg.BuildSessionFactory(), I get the following error (copied from the log):

"NHibernate.MappingException: An association from the table Customers refers to an unmapped class: IList`1"

I don't understand the cause of the error or how to fix it. Any help would be greatly appreciated. Thanks in advance!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 11, 2007 8:07 am 
Beginner
Beginner

Joined: Wed Nov 08, 2006 8:24 am
Posts: 26
Location: Gothenburg, Sweden
Can you attach the complete hibernate mappings?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 11, 2007 8:50 am 
Beginner
Beginner

Joined: Fri Jul 06, 2007 9:27 pm
Posts: 22
Thanks--I found the problem. Turns out I had an extra line of markup left from an old version at the end of the mapping file. Deleted that, and it works fine.


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