-->
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: hbm2net 0.7 -> 0.8
PostPosted: Tue May 31, 2005 11:43 pm 
Newbie

Joined: Tue May 31, 2005 11:19 pm
Posts: 11
Location: Brisbane, Australia
Hi,

I'm having some trouble with hbm2net following a change from Contrib-0.7.0.0 to Contrib 0.8.4.0 and would be grateful for any input

Firstly, I'm getting an issue with the xmlns declaration in the mapping file.
If my .hbm.xml file contains a namespace declaration like this:
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">

My class is not generated where it would have been using 0.7.0.0.

I had a look into the code and think it's related to the following type of code changes in CodeGenerator.cs
0.7.0.0:
Code:
IEnumerator classElements = rootElement.SelectNodes("urn:class", nsmgr).GetEnumerator();

0.8.4.0
Code:
IEnumerator classElements = rootElement.SelectNodes("class", nsmgr).GetEnumerator();

With 0.8.4.0, classElememts comes back empty. If I change this line back to match 0.7.0.0 and recompile, my class is generated again.

I also find if I remove the namespace declaration and successfully generate a .cs class using 0.8.4.0, when I later try to load the mapping in NHibernate i get an XML validation schema error for <hibernate-mapping> - so I'm sure the declaration is required at application runtime.

My Second problem is with declaring the assembly in a class name.
For with example the class declaration
Code:
<class table="File" class=MyNamespace.File, MyAssembly">

hbm2net tries to generate a file called MyNamespace\File, Myassembly.cs.

At runtime, NHibernate will not find my class without declaring the Assembly.
Contrib-0.7.0.0 doesn't have this issue - it generates MyNamespace\File.cs

Thanks for any info you can provide on the changes between these versions.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 30, 2005 2:16 am 
Newbie

Joined: Tue Jun 28, 2005 8:46 am
Posts: 2
Location: Denmark
Have a look at http://nhibernate.sourceforge.net/forum ... .php?t=246


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.