How to map SubClasses with Composite Keys
Hi
I'm trying to create a table-per-entity mapping for a 2 tables with a composite primary key - how do I map the sub-class...? I found a issue that said that this had been fixed in the 1.0 version, but I can't figure out how to do it...!
Cheers
Matt
Comments are currently closed for this discussion. You can start a new one.
2 Posted by asa.jones on 27 Apr, 2010 10:42 AM
I think i have managed this using the "SubclassMap" class
I make sure that my business objects are inherited correctly, therefore I have a Person class which inherits from the Party class.
You specify the "KeyColumn" in the Subclass Map.
For composites you need to repeat the KEYClumn method for each field.
I've experience some issues with this in the past where it appears the order in which you add the Columns is relevant
The two maps are included below.
public sealed class PartyRoleMap: ClassMap
Hope this helps
James Gregory resolved this discussion on 16 May, 2010 05:31 PM.