Chapter 1. The Configuration and Schema

In this chapter, we will cover the following recipes:

  • Installing NHibernate
  • Configuring NHibernate with hibernate.cfg.xml
  • Configuring NHibernate with App.config or Web.config
  • Configuring NHibernate with code
  • Configuring NHibernate with Fluent NHibernate
  • Configuring NHibernate logging
  • Generating the database
  • Scripting the database
  • Updating the database
  • Using NHibernate schema tool

Introduction

NHibernate is a popular, mature, open source Object-Relational Mapper (ORM) based on Java's Hibernate project. ORMs, such as LINQ to SQL, Entity Framework, and NHibernate, translate between the database's relational model of tables, columns, and keys to the application's object model of classes and properties.

The NHibernate homepage, ...

Get NHibernate 4.x Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.