Within our system we have the concept of an employee. It contains your basic employee data such as name, address, etc. We are in the process of building a new application that needs this core employee data but also needs to track information about a driver. Because a driver has the same characteristics as an employee we are building this using the joined-subclass functionality in NHibernate. The employee is the "base" class, and the driver inherits from it, plus it has a few extra properties.
Tables: Employee Name, Address, etc Driver Drivers license number, etc.... I'm finding that if a record has been persisted through the employee, there isn't a way to load that employee a driver. Which makes sense because a driver record with the employee's primary key was not created. The reason that this is needed is due to the fact that we have a set of "core" tables that are shared across many of our applications. In this case that table is Employee. Depending upon what application you're working with the context changes. Some applications you're managing employees, and in another you're managing drivers. So here is my question. Without writing some hack to insert a driver record in the database; Is there a way that I can load an employee in the context of a driver and have NHibernate understand that once it is persisted the employee record is an update, and the driver record would be an insert if it is the first time opening it in the driver context? Else, it is just an update to both tables. Thanks, Dan -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
