sergey wrote:
Does the mapping for your Employee class contain the mapping for SystemName property?
Sorry for the belated reply, thought I had it set up to e-mail me when a response was posted.
Anyways, thanks for the response. To answer your question:
No, the Employee mapping does not include a property mapping for the SystemName property. The reason is because the subclass tables (ContractorEmployee and RegularEmployee) each have a different column name that populates the derived SystemName property. So, if I were to put <property name="SystemName" ... /> in the Employee mapping, I could not include the "column" attribute, because it differs for each subclass.
I currently have the "SystemName" property mapping in each of the subclass mappings, which allows me to specify the different column names. I figured that NHibernate might be able to determine this possibility. Would it work if the column names in both of the subclass tables were the same? Would that allow me to add the property mapping to the Employee map, or would NHibernate only look in the superclass table for the column?
BTW, I'm using "table-per-subclass", in case that wasn't evident.
Thanks!