CONTENTS

CHAPTER 1: GETTING STARTED WITH NHIBERNATE 3

What Is an ORM?

Creating a Sample Project: The GuitarStore

Project Requirements

Creating the GuitarStore Solution

Creating the Database

Configuring NHibernate

Downloading and Installing NHibernate

Creating the Class Files

Creating the Mapping Files

Mapping by Code

Understanding the property-ref Attribute

Configuration Techniques

Creating a Console Application for Testing

Configuring the GuitarStore WPF Program

Initializing NHibernate

Adding and Populating the DataGrid Control

Adding and Populating a ComboBox

Filtering the DataGrid Based on the ComboBox Selection

Understanding Lazy Loading

Configuring Logging Using log4net

The Appender

The Logger

Configuring Your Program to Use log4net

Serializing Startup

Serializing the Configuration

Validating a Serialized Configuration

Loading the Current Serialized Configuration

Using a Serialized Configuration

Timing the Startup

Interceptors and Events

Interceptors

Events

Implementing the Interceptor and Event Classes

Summary

CHAPTER 2: USING HQL

Introduction

Working with CreateQuery()

Implementing Paging

Using the Database Round-Trip Counter

Working with Calculated Fields

Implementing CreateMultiQuery()

Understanding GetNamedQuery()

Implementing Aggregate Database Functions with GetNamedQuery

Understanding DetachedQuery

Working with DetachedNamedQuery

Understanding Futures

Summary

CHAPTER 3: USING ICRITERIA

Introduction

Understanding the Stateless Session

Working with CreateCriteria ...

Get Working with NHibernate 3.0 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.