
In this article we clear the question from the end of the first article, How do we manage a persistent object across sessions? .
In this seventh article and its client code, we will demonstrate that the classes we have put forth to incorporate the shipping functionality will allow shipment items of an order to be shipped in parts by multiple shipping services.
We will discuss one of four ways of mapping inheritance hierarchies in Nhibernate; the way which gives maximum support for inheritance and polymorphism (the main benefit of capturing an inheritance heirarchy). This is called Table Per Subclass.
The idea here is to apply the Many-To-Many entity association in the E-Commerce scenario used, for example, throughout this article series.
This is Part 5A of the article series, which concentrates on Many-to-Many Entity Association with a commonly used example but the model and code is a little different.
Here in this article the intent is to eliminate the nulls introduced in the database by correctly mapping the association between PaymentApprovedOrder and Item as optional One-To-Many.
Firstly in part 1 of this article series, it had been shown that in ORM, while mapping a one-to-one association between objects to their corresponding tables, the primary key of one table is posted as a foreign key of the other table. But in ORM, mapping a one-to-many association is done differently
Object-Relational Mapping (ORM) is a programming technique that allows developers to interact with a relational database using object-oriented programming paradigms. It bridges the gap between the object-oriented domain model used in application code and the relational database model used for data storage. ORM frameworks like NHibernate facilitate the mapping between objects and database tables, automating much of the data access and manipulation processes.
To establish the ideas of Object Relational Mapping Internals, Nhibernate fundamentals, Intemediate and Advanced coding concepts using NHibernate more clearly (for me and hopefully to readers).
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegisterMembers onlyWrite an article and earn +1,000 SHARP when it is approved.
Write an article