-->
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.  [ 8 posts ] 
Author Message
 Post subject: NHibernate : tools ?
PostPosted: Thu May 03, 2007 5:45 pm 
Newbie

Joined: Thu May 03, 2007 5:42 pm
Posts: 1
Hello,
does any one know some graphical & generation tools for NHibernate in order to generate HBM files ** from the C# code ** ?

Thanx,
messaoud


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 04, 2007 3:04 am 
Beginner
Beginner

Joined: Mon Aug 15, 2005 11:50 pm
Posts: 22
There are templates for CodeSmith http://www.codesmith.com and MyGeneration http://www.mygenerationsoftware.com for creating hbm.xml files. I personally use the MyGeneration stuff.

They generate the hbm from the database, not the c# code though.

Not sure about the GUI, there is a great one for ActiveRecord http://altinoren.com/activewriter/ I can't remember if it was NHibernate compatible.

Regards,
Jason


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 17, 2007 10:06 pm 
Newbie

Joined: Thu Dec 13, 2007 6:20 am
Posts: 3
Hi all,
I am new to NHibernate. I read documents, practiced something, and I think NHibernate is cool to mapping database to object. But I don't want to write mapping xml by hand because it makes mistakes easily and write too much.

http://www.codesmith.com doesn't work, maybe it is http://www.codesmithtools.com/ .

I had database and coded class. I just want mapping xml.
MyGeneration generates code from database. If I use it, I'll have to merge my old file with new generated class. It's too risk. Am I wrong ? (maybe I don't know enough about MyGeneration)
ActiveRecord is the same.

I'm reading about codesmith, maybe it's good.

Are there any other tools ?

Thanks
imagic


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 18, 2007 7:00 am 
Regular
Regular

Joined: Wed Oct 25, 2006 10:51 pm
Posts: 71
imagic wrote:
Hi all,
I am new to NHibernate. I read documents, practiced something, and I think NHibernate is cool to mapping database to object. But I don't want to write mapping xml by hand because it makes mistakes easily and write too much.


You can also use attributes if it's just typos you're worried about:
http://www.hibernate.org/hib_docs/nhibernate/html/mapping-attributes.html


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 19, 2007 2:14 am 
Newbie

Joined: Thu Dec 13, 2007 6:20 am
Posts: 3
Oh, thank you very much.
Will it generate mapping xml file when I add some attributes ?
I'm reading this tutorial. If there are some tutorials, samples, articles... about this, please sent to me. Thanks a lot :)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 19, 2007 2:53 am 
Newbie

Joined: Thu Dec 13, 2007 6:20 am
Posts: 3
Hi,
I can't make a sample code for that. Please help me.

Thanks
imagic


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 19, 2007 1:26 pm 
Newbie

Joined: Wed Nov 21, 2007 8:14 pm
Posts: 2
Location: UK
I came across this plug-in for visual studion 2005 today. http://sourceforge.net/projects/nhibernateaddin.

To use it you create a data connection to a database that contains the structure you are going to code against (your development database).

Next step is to add a new NHibernate plug-in item (via add new item) to your project that will contain you domain objects. In the property window add the data connection string from the data connection you just created (this isn't automated yet).

Finally you drag and drop your tables from your data connection to the NHibernate plug-in object and when saved your mapping files and you domain objects are generated.

Hope this helps.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 21, 2007 12:35 am 
Beginner
Beginner

Joined: Mon Apr 24, 2006 1:43 pm
Posts: 22
imagic wrote:
MyGeneration generates code from database. If I use it, I'll have to merge my old file with new generated class. It's too risk. Am I wrong ?


You can also create partial classes, so you can keep generated code in one file and your stuff in the other. It's easy to modify MyGeneration and CodeSmith templates to create partial classes.

HTH, Tom


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