NHibernate 3.0 Cookbook

Front Cover
Packt Publishing Ltd, Oct 4, 2010 - Computers - 328 pages
0 Reviews
Get solutions to common NHibernate problems to develop high-quality performance-critical data access applications. This book contains quick-paced self-explanatory recipes organized in progressive skill levels and functional areas. Each recipe contains step-by-step instructions about everything necessary to execute a particular task. The book is designed so that you can read it from start to end or just open up any chapter and start following the recipes. In short this book is meant to be the ultimate "how-to" reference for NHibernate 3.0, covering every major feature of NHibernate for all experience levels. This book is written for NHibernate users at all levels of experience. Examples are written in C# and XML. Some basic knowledge of SQL is assumed.
 

What people are saying - Write a review

We haven't found any reviews in the usual places.

Selected pages

Contents

Using QueryOver projections and aggregates
Using MultiCriteria
Using the Hibernate Query Language
Using MultiQuery
Using Named Queries
Using Futures
Eager loading child collections
Using LINQ to NHibernate

Customer support
Chapter 1 Models and Mappings
Mapping a class with XML
Creating class hierarchy mappings
Mapping a onetomany relationship
Setting up a base entity class
Handling versioning and concurrency
Creating mappings fluently
Mapping with ConfORM
Bidirectional onetomany class relationships
Mappings enumerations
Creating class components
Chapter 2 Configuration and Schema
Configuring NHibernate with Appconfig
Configuring NHibernate with hibernatecfgxml
Configuring NHibernate with code
Configuring NHibernate with Fluent NHibernate
Configuring NHibernate using ConfORM Mappings
Configuring NHibernate logging
Reducing application startup time
Generating the database
Scripting the database
Using NHibernate Schema Tool
Chapter 3 Sessions and Transactions
Setting up session per web request
Setting up session per presenter
Creating a session ASPNET MVC action filter
Creating a Transaction ASPNET MVC action filter
Using the Conversation per Business Transaction pattern
Using sessionMerge
Using sessionRefresh
Using stateless sessions
Using dictionaries as entities
Using NHibernate with TransactionScope
Chapter 4 Queries
Using Criteria Queries
Using QueryOver
Using Detached Queries
Using HQL for bulk data changes
Chapter 5 Testing
Using NHibernate Profiler
Fast testing with SQLite inmemory database
Preloading data with SQLite
Using the Fluent NHibernate Persistence Tester
Using the Ghostbusters test
Chapter 6 Data Access Layer
Transaction Autowrapping for the data access layer
Setting up an NHibernate Repository
Using Named Queries in the data access layer
Using ICriteria in the data access layer
Using Paged Queries in the data access layer
Using LINQ Specifications in the data access layer
Chapter 7 Extending NHibernate
Creating an encrypted string type
Using wellknown instance type
Using dependency injection with entities
Creating an auditevent listener
Creating and changing stamping entities
Generating triggerbased auditing
Setting MS Sqls Context Info
Using dynamic connection strings
Chapter 8 NHibernate Contribution Projects
Configuring the cache
Configuring the cache with code
Property validation with attributes
Creating validator classes
Using the Burrows framework
Setting up fulltext search
Sharding databases for performance
Using NHibernate Spatial
Chapter 9 Menu
ASPNET Web Forms applications
WPF and WinForms applications
Copyright

Other editions - View all

Common terms and phrases

Bibliographic information