Devart Blog

Entity Developer

Support of Many-to-One Mapping for Component Navigation Properties in Entity Developer

Posted by on May 24th, 2012

This article explains and gives a practical example of how support of сomponent navigation properties is implemented in Entity Developer for NHibernate.
Support of this functionality includes the possibility of detaching to a complex type for further reusability not only scalar entity properties but also navigation properties with subsequent customization of complete mapping at the level of private mapping of a certain property with type equal to complex type of a certain entity.

There are several ways of component navigation properties mapping in NHibernate:

  • Many-to-one;
  • One-to-many;
  • One-to-one;
  • Many-to-many.

In this article we will consider the most popular of them, i.e. many-to-one mapping of сomponent navigation properties. We will not focus on one-to-many and one-to-one types of сomponent navigation properties mapping, as these types of mapping are not very common, besides, their usage and customization have little difference from the example under consideration and so are quite comprehensible. Many-to-many mapping is considered in details in the article Support of Many-to-Many Mapping for Component Navigation Properties in Entity Developer.