-->
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: Problems in using hbm2net
PostPosted: Fri Jun 10, 2005 11:40 am 
I am planning to make nhibernate the foundation of data access architecture in my system.
But I am having a major roadblock in using hbm2net. What am I doing wrong ?

HERE IS MYDATASOURCETEST.HBM.XML :

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="TestProject.customer TestProject" table="CUSTOMER">
<id name="custId" column="CUST_ID" type="String(10)">
<generator class="native" />
</id>
<property name="firstName" column="FIRST_NAME" type="String(20)" />
<property name="lastName" column="LAST_NAME" type="String(20)" />
<property name="phone" column="PHONE" type="Int32" />
</class>
</hibernate-mapping>


HERE IS MYCODEGEN.XML

<?xml version="1.0" ?>
<codegen>
<generate renderer="NHibernate.Tool.hbm2net.BasicRenderer">
</generate>
</codegen>


THIS IS THE COMMAND I AM USING:

C:\dotNet\NHibernateContrib\bin>NHibernate.Tool.hbm2net.exe --config=c:\DotNetProjects\TestProject\MyCodeGen.xml --output="c:\Do
tNetProjects\TestProject" c:\DotNetProjects\TestProject\*.hbm.xml

RESULT :

Zilch ! Nada ! and considerable frustration. It is not generating any C# classes.

HERE IS PART OF OUTPUT:

2005-06-09 23:30:37,406 [3420] INFO NHibernate.Tool.hbm2net.CodeGenerator [] <>
- c:\DotNetProjects\TestProject\myDataSourceTest.hbm.xml
2005-06-09 23:30:38,250 [3420] INFO NHibernate.Tool.hbm2net.Generator [] <> - G
enerating 0 in c:\DotNetProjects\TestProject


Appreciate any help.


Top
  
 
 Post subject: xmlns declaration
PostPosted: Wed Jun 22, 2005 1:22 am 
Newbie

Joined: Tue May 31, 2005 11:19 pm
Posts: 11
Location: Brisbane, Australia
This may be related to the problems I've experienced:
http://nhibernate.sourceforge.net/forum ... .php?t=159

Does it work if you drop the xmlns delaration from the top of the .hbm.xml file? (nhibernate itself doesn't like it without but I found the hbm2net tool worked)

Try downloading version 0.7 and generating with that...


Top
 Profile  
 
 Post subject: Problems in using hbm2net
PostPosted: Tue Jun 28, 2005 8:56 am 
Newbie

Joined: Tue Jun 28, 2005 8:46 am
Posts: 2
Location: Denmark
Hi

Had the same problems

I made a few modifications adding "crn:" at every SelectNodes() call and now the code is generated fine...

The modification also supports the "namespace" attribute in the RootNode instead of "package"

The source is upgraded to compile with C# express 2005 Beta 2 and can be downloaded at http://www.orwtech.dk/download/nhibernate-contrib.zip


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.