I have a question regarding inheritance and object loading. Here's an abstract example:
class Person;
class Employee : Person;
class Manager : Employee
class SalesPerson : Employee
This would be mapped using the joined-subclass strategy such that all data common to all Person types is stored in the Person table and "table inheritence" is used for each Person type-specific data.
Now, here's my question: say I have the following mapped object:
Code:
class LineOfBusiness {
public IList Managers {
get;
set;
}
public IList Employees {
get;
set;
}
public IList SalesPeople{
get;
set;
}
}
(Essentially, a LineOfBusines would have Employees doing the work, Managers managing the Employees, and SalesPeople that are assigned to "sell, sell, sell" the services of the LineOfBusiness...)
When I try this, I get an error when a Person object is loaded that is both a SalesPerson and a Manager, when using Session.Load(typeof(LineOfBusiness), someId).
Is this possible with NHibernate? I realize that my "LineOfBusiness" example isn't that great and I can try to elaborate on it if need be.
Thanks for any suggestions.