This is example of how to work with database relations (objects associations) using NHibernate and NHibernate.Mapping.Attributes
There are 3 types of associations Nhibernate supports (with a few subtypes):
- one-to-one (use PRIMARY KEY)
- one-to-many (use FOREIGN KEY)
- many-to-many
This example also demonstrates:
- usage of lazy loading and eager objects fetching;
- INSERT INTO ... SELECT in Hibernate Query Language (HQL)