Fluent NHibernate uses a lot of conventions to map our domain model to a database schema. All of these conventions make sense in most of the day-to-day projects. Sometimes, it is important that we are able to add our own conventions to the mapping process, or even replace existing conventions with our own specific implementations. Fluent NHibernate is very flexible in this regard and offers us the possibility to fine-tune the system.
Conventions are added to the system during initialization, that is, before the mappings are processed. In Chapter 8, which talks about configuration, we will discuss how to add conventions in detail.
During the definition of the mappings for our ordering system domain, you might have noticed that we had to define the mapping of Id
for each entity. Specifically, we had to define that we want to use the HiLo
generator for ID generation over and over again. If we did not define the generator to use, then the default convention...