O'Reilly logo

NHibernate 3 Beginner's Guide by Gabriel N. Schenker

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

XML mapping

To add IntelliSense capabilities to Visual Studio for the NHibernate mapping files, we add the .xsd files, which are part of the NHibernate download, to the solution. For this, create a solution folder named Schema and add the two XML schema definition files nhibernate-configuration.xsd and nhibernate-mapping.xsd to this folder, as shown in the following screenshot:

XML mapping

When defining mapping for an entity, we add a new XML file to the project. The file has to have the extension .hbm.xml. As the name of the file, it is recommended to use the name of the entity you want to map, for example, Product.hbm.xml when mapping the Product entity. As ...

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