O'Reilly logo

NHibernate 3.0 Cookbook by Jason Dentler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mapping a class with XML

The suggested first step in any new NHibernate application is mapping the model. In this first example, I'll show you how to map a simple product class.

Getting ready

Before we begin mapping, let's get our Visual Studio solution set up. Follow these steps to set up your solution with NHibernate binaries and schemas.

  1. Download the NHibernate 3.0 binaries from SourceForge at http://sourceforge.net/projects/nhibernate/files/. The filename should be NHibernate-3.0.0.GA-bin.zip, perhaps with a slightly different version number.
  2. In Visual Studio, create a new C# class library project named Eg.Core with a directory for the solution named Cookbook.
  3. Delete the Class1.cs file.
  4. In the Solution Explorer, right-click on the Cookbook solution ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required