XML mappings for the Employee class

Learning mapping through documentation may not be the best experience for beginners. What can work better is using one of the classes from our domain model as an example and guiding you through the mapping exercise. That is exactly what we are going to do in this section. We will begin our journey with writing XML mapping for the Employee class.

The Employee class has some attributes of primitive type as well as collections and associations to other classes. To keep things simple in the beginning, we will first look at mappings of the primitive attributes of the Employee class and not the associations to the other classes. The objective is to understand how to declare simple mappings before we start handling ...

Get Learning NHibernate 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.