I have next problem, I have class hierarchy TechnoCardItemInput and TechnoCardItemOutput are inherited from base TechnoCardItem, and mapped using "Table per class hierarchy" method.
Another class TechnoCard has collections of TechnoCardItemInput and TechnoCardItemOutput as properties and mapping file has following declarations:
Code:
<bag name="Input" cascade="all" inverse="true">
<key column="TechnoCardID" />
<one-to-many class="DeliveryNoteHandler.Core.Domain.TechnoCardItemInput, DeliveryNoteHandler.Core" />
</bag>
<bag name="Output" cascade="all" inverse="true">
<key column="TechnoCardID" />
<one-to-many class="DeliveryNoteHandler.Core.Domain.TechnoCardItemOutput, DeliveryNoteHandler.Core" />
</bag>
When loading TechnoCard from database the next error occurs:
"Object with id: 3 was not of the specified sublcass: DeliveryNoteHandler.Core.Domain.TechnoCardItemInput (loading object was of wrong class [DeliveryNoteHandler.Core.Domain.TechnoCardItemOutput])"
How can I solve this problem?