Chapter 3. Writing and mapping classes

This chapter covers

  • POCO basics for rich domain models
  • The concept of object identity and its mapping
  • Mapping class inheritance
  • Association and collection mappings

The “Hello World” example in chapter 2 gave a gentle introduction to NHibernate; but we need a more thorough example to demonstrate the needs of real-world applications with complex data models. For the rest of the book, we explore NHibernate using a more sophisticated example application—an online auction system.

We start our discussion of the application by introducing a programming model for persistent classes.

First, you’ll learn how to identify the business objects (or entities) of a problem domain. You’ll create a conceptual model ...

Get NHibernate in Action now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.