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
Publisher resources
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
40 Algorithms Every Programmer Should Know
Learn algorithms for solving classic computer science problems with this concise guide covering everything from fundamental …
book
Hands-On Design Patterns with C# and .NET Core
Apply design patterns to solve problems in software architecture and programming using C# 7.x and .NET …
book
NHibernate 4.x Cookbook - Second Edition
Over 90 incredible and powerful recipes to help you efficiently use NHibernate in your application About …
book
Software Architect's Handbook
A comprehensive guide to exploring software architecture concepts and implementing best practices Key Features Enhance your …