Consider an application consisting of Employees and Administrators.
An employee consists of an EmployeeId, Name and EmailAddress.
The employees are stored in a legacy system and are readonly so I have an immutable Employee class mapped to a view (vw_Employee) as follows:
[vw_Employee] -> EmployeeID(key), Name, EmailAddress
Now for this application, some of the employee's will be marked as administrators (Image a screen with a drop down list of employees, you select one, click add and that employee is now an administrator).
An administrator is an employee (has exactly the same fields) so the database table only needs to look like the following:
[Administrators] -> EmployeeID(key)
In the same application, I will need to display a list of all the administrators names and email address
Without NHibernate I could get a list of administrators by joining the [Administrators] table with the [vw_Employee] view using the EmployeeID primary key
The issue I'm having is what should the Administrator class look like and how would I map this using NHibernate.
Any help would be much appreciated