Chapter 2. Hello NHibernate!

 

This chapter covers

  • NHibernate in action with a “Hello World” application
  • How to architecture an NHibernate application
  • Writing and mapping a simple entity
  • Configuring NHibernate
  • Implementing primitive CRUD operations

It’s good to understand the need for object/relational mapping in .NET applications, but you’re probably eager to see NHibernate in action. We start by showing you a simple example that demonstrates some of its power.

As you’re probably aware, it’s traditional for a programming book to start with a “Hello World” example. In this chapter, we follow that tradition by introducing NHibernate with a relatively simple “Hello World” program. But printing a message to a console window won’t be enough to really demonstrate NHibernate. Instead, your program will store newly created objects in the database, update them, and perform queries to retrieve them from the database.

This chapter forms the basis for the subsequent chapters. In addition to the canonical “Hello World” example, we introduce the core NHibernate APIs and explain how to configure NHibernate in various runtime environments, such as ASP.NET applications and standalone WinForms applications.

2.1. “Hello World” with NHibernate

 
 
 

2.2. Understanding the architecture

 
 

2.3. Basic configuration

 
 
 

2.4. Advanced configuration settings

 

2.5. Summary

 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest