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?