Book description
Explore the full potential of NHibernate to build robust data access code
In Detail
Connecting the object-oriented world of .NET to the relational world of databases has always been fiddly but with the onset of ORMs such as NHibernate, developers have finally got some relief in this area.
You will begin with a bird's eye view of NHibernate, touching upon its core concepts. You will define domain model and map it with database schema using different techniques. You will then look into multiple ways of storing domain entities in a database and learn important concepts such as transitive persistence, transactions and unit of work. This will be followed by retrieving data from database. Next, you will optimize your code, explore concepts such as the onion architecture, and learn where NHibernate fits best in an application's architecture. After introducing a well-known repository pattern into our application, you will learn to deal with legacy databases. We will conclude with infrequently used features such as stateless sessions, the second level cache, concurrency, and so on, which might come handy.
What You Will Learn
- Map domain entities to a database schema using the different mapping mechanisms available
- Configure NHibernate through XML configuration
- Save, update, and delete entities in the database and query data from a database using different querying methods
- Optimize database operations for speed and memory consumption
- Use NHibernate in real-life software projects
- Get to know about data access patterns such as repository, specification, and query object
- Use NHibernate with legacy databases
Table of contents
-
Learning NHibernate 4
- Table of Contents
- Learning NHibernate 4
- Credits
- About the Author
- About the Reviewers
- www.PacktPub.com
- Preface
- 1. Introduction to NHibernate
- 2. Let's Build a Simple Application
-
3. Let's Tell NHibernate About Our Database
- Important NHibernate terminology
- Mapping the prerequisites
- Different mechanisms to write the mappings
- XML mappings for the Employee class
- Identifier generation
- Mapping associations
- Mapping inheritance
- Mapping components
- Mapping by code
- Fluent mapping a.k.a. Fluent NHibernate
- Choosing the right mapping method
- Summary
- 4. NHibernate Warm-up
- 5. Let's Store Some Data into the Database
- 6. Let's Retrieve Some Data from the Database
- 7. Optimizing the Data Access Layer
-
8. Using NHibernate in a Real-world Application
- What kind of application are we building?
- Architectural principles we will follow
- Feature 1 – onboarding an employee
- Unit of work
- Feature 2 – updating the details of an employee
- Feature 3 – searching employees
- Summary
- 9. Advanced Data Access Patterns
- 10. Working with Legacy Database
- 11. A Whirlwind Tour of Other NHibernate Features
- Index
Product information
- Title: Learning NHibernate 4
- Author(s):
- Release date: July 2015
- Publisher(s): Packt Publishing
- ISBN: 9781784393564
You might also like
book
Working with NHibernate 3.0
This book provides examples using the IQuery, ICriteria, QueryOver, and LINQ to NHibernate API's within the …
book
NHibernate 4.x Cookbook - Second Edition
Over 90 incredible and powerful recipes to help you efficiently use NHibernate in your application About …
book
Beginning Hibernate: For Hibernate 5
Get started with the Hibernate 5 persistence layer and gain a clear introduction to the current …
video
ASP.NET MVC 5
5½+ Hours of Video Instruction Overview ASP.NET MVC 5 LiveLessonsprovides web developers with an introduction to …