-->
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.  [ 5 posts ] 
Author Message
 Post subject: <bag> gives MappingException
PostPosted: Mon May 28, 2007 8:56 am 
Newbie

Joined: Mon May 28, 2007 8:45 am
Posts: 3
Maybe I'm asking a dumb question but I'm new to NHibernate.

Having just downloaded NHibernate version 1.2.0.GA and trying to make a simple thing work.
This mapping gives me MappingException "Could not compile the mapping document: NHibernateTest.Organization.hbm.xml" without any explanation.
The problem is with the "<bag/>" thing. If I remove it - everything is ok.

Can anyone explain me what's wrong in this code?
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernateTest" namespace="NHibernateTest">
   <class name="Organization" table="[Organization]">
      <id name="Id" type="Guid">
         <generator class="guid.comb" />
      </id>
      <property name="Name" type="String" length="255"/>
      <many-to-one name="Group" class="OrganizationGroup" column="GroupId"/>
   </class>

   <class name="OrganizationGroup" table="[Organization.Group]">
      <id name="Id" type="Guid">
         <generator class="guid.comb" />
      </id>
      <property name="Name" type="String" length="255"/>
      
      <bag name="Origanizations" inverse="true">
         <key column="GroupId" />
         <one-to-many class="Organization" />
      </bag>
      
   </class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 28, 2007 2:10 pm 
Regular
Regular

Joined: Sun Jan 21, 2007 4:33 pm
Posts: 65
You are putting your mappings as an embedded resource in your assembly, and not compiling them, correct?


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 29, 2007 1:39 am 
Newbie

Joined: Mon May 28, 2007 8:45 am
Posts: 3
Certainly.
It works pretty ok without that <bag> element.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 29, 2007 2:43 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Look in the InnerException of the exception you are getting.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 29, 2007 4:01 am 
Newbie

Joined: Mon May 28, 2007 8:45 am
Posts: 3
There is no InnerException for this error.
Empty NHibernate.MappingException with message "Could not compile the mapping document: NHibernateTest.Organization.hbm.xml"


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