-->
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.  [ 1 post ] 
Author Message
 Post subject: Nhibernate, Hibernate HBM files and namespaces
PostPosted: Tue Feb 06, 2007 6:23 pm 
Newbie

Joined: Thu Aug 04, 2005 3:06 pm
Posts: 3
Location: Chitizzle
Hi, guys

I'm a user of Hibernate for Java and am currently taking a stab at a .NET 2.0 application using NHibernate.

I usualy generate HBM files from the DB schema using hibernate-tools and Ant. From these files I'd usualy generate the source files.

From my understanding HBM files made by the Java version should be consumable by NHibernate. And for the most part it seems like they are, except for the namespaces that NHibernate.Tool.hbm2net.CodeGenerator insists upon.

If I take a freshly generated HBM file and unleast CodeGenerator on it nothing will happen.

To make things "go" I need to either:

a) Get rid of name space refferences in the CodeGenerator source i.e. by changing:

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


to

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


b) Manualy edit the HBM files changing:
Code:
<hibernate-mapping >


to

Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">


My question is why are this namespace required? What benefits does it give me?

Would anyone have a problem if the CodeGenerator class had a switch or option to disable this requirement?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.