NHibernate in Action
Pierre Henri Kuaté, Tobin Harris, Christian Bauer, and Gavin King
  • February 2009
  • ISBN 9781932394924
  • 400 pages
  • printed in black & white

A much needed book for novices and experts.

Mark Monster, Rubicon

In the classic style of Manning's "In Action" series, NHibernate in Action introduces .NET developers to the NHibernate Object/Relational Mapping tool. As NHibernate is a port of Hibernate from Java to .NET, the book is based on Manning's bestselling Hibernate in Action.

NHibernate in Action begins by describing how to implement persistence in a layered .NET application. The book then quickly springs into action by introducing NHibernate through a classic "Hello World" example. It explains how to configure NHibernate to specify the mapping information between business objects and database tables, and then explores the internal architecture of NHibernate. A complete example application is progressively built with Agile methodologies in mind, which shows readers all kinds of entity and relationship mappings and how to perform CRUD operations. The book also covers advanced techniques like caching, concurrency access, and isolation levels. The Hibernate Query Language (HQL) and criteria query APIs are thoroughly detailed with optimization tips.

The last chapters of this book discuss various development scenarios, how to implement the layers of an NHibernate application (covering Windows and Web development), and which tools are available for these tasks. They also provide some solutions for data-binding objects to .NET GUI controls, integrating services, and interacting with components using DataSets. Finally, they explain how to build a complex application involving advanced session management and distributed transactions.

Table of Contents show full

foreword

preface

acknowledgments

about this book

Part 1 Discovering ORM with NHibernate

1. Object/relational persistence in .NET

1.1. What is persistence?

1.2. Approaches to persistence in .NET

1.3. Why do we need NHibernate?

1.4. Object/relational mapping

1.5. Summary

2. Hello NHibernate!

2.1. “Hello World” with NHibernate

2.2. Understanding the architecture

2.3. Basic configuration

2.4. Advanced configuration settings

2.5. Summary

Part 2 NHibernate deep dive

3. Writing and mapping classes

3.1. The CaveatEmptor application

3.2. Implementing the domain model

3.3. Defining the mapping metadata

3.4. Basic property and class mappings

3.5. Understanding object identity

3.6. Fine-grained object models

3.7. Introducing associations

3.8. Mapping class inheritance

3.9. Summary

4. Working with persistent objects

4.1. The persistence lifecycle

4.2. The persistence manager

4.3. Using transitive persistence in NHibernate

4.4. Retrieving objects

4.5. Summary

5. Transactions, concurrency, and caching

5.1. Understanding database transactions

5.2. Working with conversations

5.3. Caching theory and practice

5.4. Summary

6. Advanced mapping concepts

6.1. Understanding the NHibernate type system

6.2. Mapping collections of value types

6.3. Mapping entity associations

6.4. Mapping polymorphic associations

6.5. Summary

7. Retrieving objects efficiently

7.1. Executing queries

7.2. Basic queries for objects

7.3. Joining associations

7.4. Writing report queries

7.5. Advanced query techniques

7.6. Native SQL

7.7. Optimizing object retrieval

7.8. Summary

Part 3 NHibernate in the real world

8. Developing NHibernate applications

8.1. Inside the layers of an NHibernate application

8.3. Achieving goals and solving problems

8.4. Integrating services: the case of audit logging

8.5. Summary

9. Writing real-world domain models

9.1. Development processes and tools

9.2. Legacy schemas

9.3. Understanding persistence ignorance

9.4. Implementing the business logic

9.5. Data-binding entities

9.6. Filling a DataSet with entities’ data

9.7. Summary

10. Architectural patterns for persistence

10.1. Designing the persistence layer

10.2. Implementing conversations

10.3. Using NHibernate in an Enterprise Services application

10.4. Summary

Appendix A: SQL fundamentals

Appendix B: Going forward

index

© 2014 Manning Publications Co.

About the book

NHibernate in Action begins by describing how to implement persistence in a layered .NET application. The book then quickly springs into action by introducing NHibernate through a classic "Hello World" example. It explains how to configure NHibernate to specify the mapping information between business objects and database tables, and then explores the internal architecture of NHibernate. A complete example application is progressively built with Agile methodologies in mind, which shows readers all kinds of entity and relationship mappings and how to perform CRUD operations. The book also covers advanced techniques like caching, concurrency access, and isolation levels. The Hibernate Query Language (HQL) and criteria query APIs are thoroughly detailed with optimization tips.

The last chapters of this book discuss various development scenarios, how to implement the layers of an NHibernate application (covering Windows and Web development), and which tools are available for these tasks. They also provide some solutions for data-binding objects to .NET GUI controls, integrating services, and interacting with components using DataSets. Finally, they explain how to build a complex application involving advanced session management and distributed transactions.

What's inside

  • Object/Relational Mapping for .NET
  • NHibernate configuration, mapping, and query APIs
  • Development processes for the domain model and data-binding
  • Advanced session management and distributed transactions
  • Using NHibernate in real-world projects

About the author

Pierre Henri Kuaté is one of the main developers on the NHibernate project team, author of the NHibernate.Mapping.Attributes library, and a major contributor to the NHibernate forum. He's responsible for managing the NHibernate documentation, website, and forum on the Hibernate.org site. He started using NHibernate more than two years ago in commercial development.

Tobin Harris has worked with NHibernate since it was in early Beta. His passion is tools and practices that help build quality software at high speeds. As an independent consultant and entrepreneur, Tobin works with companies across the globe in various sectors including banking, personal finance, healthcare, software components and new media. In 2001, Tobin was the founder of the Open Source SqlBuddy project. Subsequently he has worked in partnership with Frost Innovation on Gaia Ajax Widgets, an Open Source Ajax suite for .NET. Tobin obtained his degree in Software Engineering at Leeds Metropolitan University, and continues to work and live in Leeds, UK.

Christian Bauer is a member of the Hibernate developer team and a trainer, consultant, and product manager for Hibernate, EJB 3.0, and JBoss Seam at JBoss. He is the lead author of Hibernate in Action and Java Persistence with Hibernate.

Gavin King is a lead developer at JBoss, the creator of Hibernate, and a member of the EJB 3.0 (JSR 220) expert group. He also leads the Web Beans JSR 299, a standardization effort involving Hibernate concepts, JSF, and EJB 3.0.


combo $49.99 pBook + eBook
eBook $39.99 pdf + ePub + kindle

FREE domestic shipping on three or more pBooks

Finally, a great book covering NHibernate.

Paul Wilson, McKesson

A must-have for NHibernate developers.

Ayende Rahien, NHibernate Committer

Accelerates your learning curve for ORM in .NET.

Doug Warren, Java Web Services