Home Page Icon
Home Page
Table of Contents for
Table of Contents
Close
Table of Contents
by Jason Dentler
NHibernate 3.0 Cookbook
NHibernate 3.0 Cookbook
Table of Contents
NHibernate 3.0 Cookbook
Credits
About the Author
About the Reviewers
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Errata
Piracy
Questions
1. Models and Mappings
Introduction
Mapping a class with XML
Getting ready
How to do it...
How it works...
There's more...
What happens to these mappings?
Surrogate keys and natural IDs
ID generator selection
See also
Creating class hierarchy mappings
Getting ready
How to do it...
How it works...
There's more...
Table per class
Table per concrete class
See also
Mapping a one-to-many relationship
Getting ready
How to do it...
How it works...
There's more...
Lazy loading collections
Lazy loading proxies
Collections
Bags
Lists
Sets
Map
See also
Setting up a base entity class
Getting ready
How to do it...
How it works...
There's more...
See also
Handling versioning and concurrency
Getting ready
How to do it...
How it works...
There's more...
Other methods of optimistic concurrency
See also
Creating mappings fluently
Getting ready
How to do it...
How it works...
See also
Mapping with ConfORM
Getting ready
How to do it...
How it works...
See also
Bidirectional one-to-many class relationships
How to do it...
How it works...
There's more...
Mappings enumerations
How to do it...
How it works...
Creating class components
How to do it...
How it works...
2. Configuration and Schema
Introduction
Configuring NHibernate with App.config
Getting ready
How to do it...
How it works...
There's more...
NHibernate properties
Dialects and drivers
See also
Configuring NHibernate with hibernate.cfg.xml
Getting ready
How to do it…
How it works…
There's more…
See also
Configuring NHibernate with code
Getting ready
How to do it…
How it works…
There's more...
See also
Configuring NHibernate with Fluent NHibernate
Getting ready
How to do it…
How it works…
See also
Configuring NHibernate using ConfORM Mappings
Getting ready
How to do it...
How it works...
There's more...
See also
Configuring NHibernate logging
Getting ready
How to do it...
How it works...
There's more...
Using log4net to troubleshoot NHibernate
See also
Reducing application startup time
Getting ready
How to do it...
How it works...
There's more...
Generating the database
Getting ready
How to do it...
How it works...
There's more...
See also
Scripting the database
Getting ready
How to do it...
How it works...
See also
Using NHibernate Schema Tool
Getting ready
How to do it...
How it works...
There's more...
See also
3. Sessions and Transactions
Introduction
Setting up session per web request
Getting ready
How to do it...
How it works...
There's more...
See also
Setting up session per presenter
Getting ready
How to do it...
How it works...
There's More...
See also
Creating a session ASP.NET MVC action filter
Getting ready
How to do it...
How it works...
There's more...
View models
See also
Creating a Transaction ASP.NET MVC action filter
Getting ready
How to do it...
How it works...
There's more...
Using the Conversation per Business Transaction pattern
Getting ready
How to do it...
How it works...
There's more...
See also
Using session.Merge
Getting ready
How to do it...
How it works...
See also
Using session.Refresh
Getting ready
How to do it...
How it works...
There's more...
See also
Using stateless sessions
Getting ready
How to do it...
How it works...
There's more...
Using dictionaries as entities
Getting ready
How to do it...
How it works...
There's more...
Partially dynamic
Using NHibernate with TransactionScope
Getting ready
How to do it...
How it works...
See also
4. Queries
Introduction
Using Criteria Queries
How to do it...
How it works...
There's more...
See also
Using QueryOver
How to do it...
How it works...
There's more...
See also
Using QueryOver projections and aggregates
How to do it...
How it works...
See also
Using MultiCriteria
How to do it...
How it works...
See also
Using the Hibernate Query Language
How to do it...
How it works...
There's more...
See also
Using MultiQuery
How to do it...
How it works...
See also
Using Named Queries
How to do it...
How it works...
There's more...
Named SQL queries
HQL AddIn
See also
Using Futures
How to do it...
How it works...
There's more...
See also
Eager loading child collections
How to do it...
How it works...
There's more...
See also
Using LINQ to NHibernate
How to do it...
How it works...
See also
Using Detached Queries
Getting ready
How to do it...
How it works...
There's more...
See also
Using HQL for bulk data changes
Getting ready
How to do it...
How it works...
There's more...
Bulk inserts
See also
5. Testing
Introduction
Using NHibernate Profiler
Getting ready
How to do it...
How it works...
There's more...
See also
Fast testing with SQLite in-memory database
Getting ready
How to do it...
How it works...
There's more...
See also
Preloading data with SQLite
Getting ready
How to do it...
How it works...
There's more...
See also
Using the Fluent NHibernate Persistence Tester
Getting ready
How to do it...
How it works...
See also
Using the Ghostbusters test
Getting ready
How to do it...
How it works...
See also
6. Data Access Layer
Introduction
Transaction Auto-wrapping for the data access layer
Getting ready
How to do it...
How it works...
There's more...
See also
Setting up an NHibernate Repository
Getting ready
How to do it...
How it works...
There's more...
See also
Using Named Queries in the data access layer
Getting ready
How to do it...
How it works...
There's more...
See also
Using ICriteria in the data access layer
Getting ready
How to do it...
How it works...
There's more...
See also
Using Paged Queries in the data access layer
Getting ready
How to do it...
How it works...
See also
Using LINQ Specifications in the data access layer
Getting ready
How to do it...
How it works...
There's more...
Specification composition
See also
7. Extending NHibernate
Introduction
Creating an encrypted string type
How to do it...
How it works...
There's more...
See also
Using well-known instance type
How to do it...
How it works...
See also
Using dependency injection with entities
Getting ready
How to do it...
How it works...
There's more...
Bland passwords need salt
See also
Creating an audit-event listener
How to do it...
How it works...
There's more...
See also
Creating and changing stamping entities
How to do it...
How it works...
See also
Generating trigger-based auditing
Getting ready
How to do it...
How it works...
See also
Setting MS Sql's Context Info
Getting ready
How to do it...
How it works...
See also
Using dynamic connection strings
How to do it...
How it works...
See also
8. NHibernate Contribution Projects
Introduction
Configuring the cache
Getting ready
How to do it...
How it works...
There's more...
Entity cache
Query cache
Update timestamp cache
The rules
See also
Configuring the cache with code
Getting ready
How to do it...
How it works...
See also
Property validation with attributes
Getting ready
How to do it...
How it works...
There's more...
See also
Creating validator classes
Getting ready
How to do it...
How it works...
There's more...
See also
Using the Burrows framework
Getting ready
How to do it...
How it works...
There's more...
See also
Setting up full-text search
Getting ready
How to do it...
How it works...
There's more...
Sharding databases for performance
Getting ready
How to do it...
How it works...
Using NHibernate Spatial
Getting ready
How to do it...
How it works...
There's more...
Geography or geometry?
What's this SRID?
Spatial data types
A. Menu
ASP.NET MVC web applications
ASP.NET Web Forms applications
WPF and WinForms applications
Index
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Cover
Next
Next Chapter
NHibernate 3.0 Cookbook
Table of Contents
NHibernate 3.0 Cookbook
Credits
About the Author
About the Reviewers
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Errata
Piracy
Questions
1. Models and Mappings
Introduction
Mapping a class with XML
Getting ready
How to do it...
How it works...
There's more...
What happens to these mappings?
Surrogate keys and natural IDs
ID generator selection
See also
Creating class hierarchy mappings
Getting ready
How to do it...
How it works...
There's more...
Table per class
Table per concrete class
See also
Mapping a one-to-many relationship
Getting ready
How to do it...
How it works...
There's more...
Lazy loading collections
Lazy loading proxies
Collections
Bags
Lists
Sets
Map
See also
Setting up a base entity class
Getting ready
How to do it...
How it works...
There's more...
See also
Handling versioning and concurrency
Getting ready
How to do it...
How it works...
There's more...
Other methods of optimistic concurrency
See also
Creating mappings fluently
Getting ready
How to do it...
How it works...
See also
Mapping with ConfORM
Getting ready
How to do it...
How it works...
See also
Bidirectional one-to-many class relationships
How to do it...
How it works...
There's more...
Mappings enumerations
How to do it...
How it works...
Creating class components
How to do it...
How it works...
2. Configuration and Schema
Introduction
Configuring NHibernate with App.config
Getting ready
How to do it...
How it works...
There's more...
NHibernate properties
Dialects and drivers
See also
Configuring NHibernate with hibernate.cfg.xml
Getting ready
How to do it…
How it works…
There's more…
See also
Configuring NHibernate with code
Getting ready
How to do it…
How it works…
There's more...
See also
Configuring NHibernate with Fluent NHibernate
Getting ready
How to do it…
How it works…
See also
Configuring NHibernate using ConfORM Mappings
Getting ready
How to do it...
How it works...
There's more...
See also
Configuring NHibernate logging
Getting ready
How to do it...
How it works...
There's more...
Using log4net to troubleshoot NHibernate
See also
Reducing application startup time
Getting ready
How to do it...
How it works...
There's more...
Generating the database
Getting ready
How to do it...
How it works...
There's more...
See also
Scripting the database
Getting ready
How to do it...
How it works...
See also
Using NHibernate Schema Tool
Getting ready
How to do it...
How it works...
There's more...
See also
3. Sessions and Transactions
Introduction
Setting up session per web request
Getting ready
How to do it...
How it works...
There's more...
See also
Setting up session per presenter
Getting ready
How to do it...
How it works...
There's More...
See also
Creating a session ASP.NET MVC action filter
Getting ready
How to do it...
How it works...
There's more...
View models
See also
Creating a Transaction ASP.NET MVC action filter
Getting ready
How to do it...
How it works...
There's more...
Using the Conversation per Business Transaction pattern
Getting ready
How to do it...
How it works...
There's more...
See also
Using session.Merge
Getting ready
How to do it...
How it works...
See also
Using session.Refresh
Getting ready
How to do it...
How it works...
There's more...
See also
Using stateless sessions
Getting ready
How to do it...
How it works...
There's more...
Using dictionaries as entities
Getting ready
How to do it...
How it works...
There's more...
Partially dynamic
Using NHibernate with TransactionScope
Getting ready
How to do it...
How it works...
See also
4. Queries
Introduction
Using Criteria Queries
How to do it...
How it works...
There's more...
See also
Using QueryOver
How to do it...
How it works...
There's more...
See also
Using QueryOver projections and aggregates
How to do it...
How it works...
See also
Using MultiCriteria
How to do it...
How it works...
See also
Using the Hibernate Query Language
How to do it...
How it works...
There's more...
See also
Using MultiQuery
How to do it...
How it works...
See also
Using Named Queries
How to do it...
How it works...
There's more...
Named SQL queries
HQL AddIn
See also
Using Futures
How to do it...
How it works...
There's more...
See also
Eager loading child collections
How to do it...
How it works...
There's more...
See also
Using LINQ to NHibernate
How to do it...
How it works...
See also
Using Detached Queries
Getting ready
How to do it...
How it works...
There's more...
See also
Using HQL for bulk data changes
Getting ready
How to do it...
How it works...
There's more...
Bulk inserts
See also
5. Testing
Introduction
Using NHibernate Profiler
Getting ready
How to do it...
How it works...
There's more...
See also
Fast testing with SQLite in-memory database
Getting ready
How to do it...
How it works...
There's more...
See also
Preloading data with SQLite
Getting ready
How to do it...
How it works...
There's more...
See also
Using the Fluent NHibernate Persistence Tester
Getting ready
How to do it...
How it works...
See also
Using the Ghostbusters test
Getting ready
How to do it...
How it works...
See also
6. Data Access Layer
Introduction
Transaction Auto-wrapping for the data access layer
Getting ready
How to do it...
How it works...
There's more...
See also
Setting up an NHibernate Repository
Getting ready
How to do it...
How it works...
There's more...
See also
Using Named Queries in the data access layer
Getting ready
How to do it...
How it works...
There's more...
See also
Using ICriteria in the data access layer
Getting ready
How to do it...
How it works...
There's more...
See also
Using Paged Queries in the data access layer
Getting ready
How to do it...
How it works...
See also
Using LINQ Specifications in the data access layer
Getting ready
How to do it...
How it works...
There's more...
Specification composition
See also
7. Extending NHibernate
Introduction
Creating an encrypted string type
How to do it...
How it works...
There's more...
See also
Using well-known instance type
How to do it...
How it works...
See also
Using dependency injection with entities
Getting ready
How to do it...
How it works...
There's more...
Bland passwords need salt
See also
Creating an audit-event listener
How to do it...
How it works...
There's more...
See also
Creating and changing stamping entities
How to do it...
How it works...
See also
Generating trigger-based auditing
Getting ready
How to do it...
How it works...
See also
Setting MS Sql's Context Info
Getting ready
How to do it...
How it works...
See also
Using dynamic connection strings
How to do it...
How it works...
See also
8. NHibernate Contribution Projects
Introduction
Configuring the cache
Getting ready
How to do it...
How it works...
There's more...
Entity cache
Query cache
Update timestamp cache
The rules
See also
Configuring the cache with code
Getting ready
How to do it...
How it works...
See also
Property validation with attributes
Getting ready
How to do it...
How it works...
There's more...
See also
Creating validator classes
Getting ready
How to do it...
How it works...
There's more...
See also
Using the Burrows framework
Getting ready
How to do it...
How it works...
There's more...
See also
Setting up full-text search
Getting ready
How to do it...
How it works...
There's more...
Sharding databases for performance
Getting ready
How to do it...
How it works...
Using NHibernate Spatial
Getting ready
How to do it...
How it works...
There's more...
Geography or geometry?
What's this SRID?
Spatial data types
A. Menu
ASP.NET MVC web applications
ASP.NET Web Forms applications
WPF and WinForms applications
Index
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset