NHibernate Part 1: Hello World with NHibernate

The Code

Updated code available for NHibernate 2.0.1.GA here.
The toolingset used is Visual Studio 2008 and Sql Server 2008

It’s been a few years now since I read for the first time about object relational mapping. It where a series of articles from Scott W. Ambler. At that time, this was a completely new appraoch but it got my attention firmly. It would however take some time and more reading to really get the importance of the concept.

The idea seeded to start experimenting with this concept and finally that time has come. After reading – searching the internet for some articles on NHibernate i didn’t realy find a “Hello World” type of application, with minimal overhead, that would get me in quickly. Most of the examples I found started with several objects and tables connected, implemented over several assemblies. Allthough they where good articles, what I wanted was a simple sample application, with one class mapped to one table showing me how to do a read operation with a minimum of overhead.

I decided to create this application myself.

Continue reading