O'Reilly logo

Learning NHibernate 4 by Suhas Chatekar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mapping inheritance

You will often have classes in your domain model that inherit from other classes. In our domain model, we have all classes representing a benefit inherited from the Benefit class. Following is a slimmed down version of the class diagram from our domain model representing this inheritance relationship:

Mapping inheritance

It is possible to map these classes to database tables as you would map any other class. But there are situations when you would want NHibernate to do more for you out of the box. One such situation involves polymorphic associations.

Polymorphic associations are associations where one of the ends is declared to be of base class type, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required