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

Implementing Paging

Implementing CreateMultiCriteria

Understanding DetachedCriteria

Working with QueryOver

Using Lambda Expressions

Understanding Futures

Using FetchMode

Configuring FetchMode in the Mapping Files

Configuring FetchMode Programmatically

Implementing Aggregate Database Functions

Understanding Restrictions and Expressions

Working with Data Transfer Objects

Summary

CHAPTER 4: USING LINQ TO NHIBERNATE

Introduction

Working with LINQ to NHibernate

Implementing Paging

Understanding LINQ to NHibernate with Lambda Expressions

Understanding Aggregate Database Functions

Summary

CHAPTER 5: MANAGING STATE AND SAVING DATA

Introduction

Understanding Concurrency

Creating an IUserType

Inserting Data

Inserting a Parent/Child into a Database

Understanding NHibernate Caching

Using the First-Level Cache

Implementing the Second-Level Cache

Understanding Evict(), Merge(), and Persist()

Using Evict()

Using Merge()

Using Persist()

Executing Batch Processes

Summary

CHAPTER 6: USING NHIBERNATE WITH AN ASP.NET MVC 3 APPLICATION

Installing ASP.NET MVC 3

Adding an ASP.NET MVC 3 Project to the GuitarStore Solution

Configuring NHibernate

Adding References to the Binaries

Adding connectionString to the Web.config File

Configuring the ASP.NET MVC Program to Use a session-per-web-request

Configuring the View and Controller

Summary

Index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.179.225