Friday, December 10, 2004

NHibernate your data...

NHibernate is a port of the ever popular Hibernate the coolest ORM mapping tool. Since i had played around quite a bit on Hibernate decided to get my hands dirty by trying out NHibernate.
The current version I am fiddling around is NHibernate Alpha 0.4.0.0(At the moment NHibernate Alpha 0.5.0.0 is also available).Though NHibernate is still in its alpha stage dont let that put you off.Its quite stable and considering its a port of the 2.0.3 version of Hibernate which has gone through a fair bit of revisions you can confidently invest time in this.The only problem is there is a shortage of documentation and articles on how to do some of the advanced features.
So lets start off with some real basics on how to persist a class in .NET through NHibernate. These are the basic steps you need to do:
Create your .NET class you want to persist and have properties on the field you want to persist.
Create your table you want to persist your .NET class in.
Create your mapping file.
Create the configuration details about the database in the config file.
And you are ready to go.Check the link to the quick start tutorial on NHibernate. I'll keep posting on how to do some advanced features and problems faced on using NHibernate and if there are any others who have used or starting out NHibernate put your comments here on suggestions and problems you have.
www.nhibernate.org (The official NHibernate web site)http://nhibernate.sourceforge.net/quickstart.html (Quick start turtorial to NHibernate)

No comments: