Hi, I'm using the TPH (Table per Hierarchy) technique to map a set of entities.
DB Schema: UserGroupLabelSpreads table having a "UserId", "GroupId" and "LabelId" nullable fields with some additional common fields.
DAL Objects: - UserGroupLabelSpread abstract class. - UserSpread with a discriminator having only non-null UserId. - GroupSpread with a discriminator having only non-null GroupId. - LabelSpread with a discriminator having only non-null LabelId.
I've managed to get this thing to work, but when I try to connect the UserSpread entity to an existing "User" entity, I'm getting the following error: Error 1 Error 3034: Problem in Mapping Fragments starting at lines 487, 554: Two entities with different keys are mapped to the same row. Ensure these two mapping fragments do not map two groups of entities with overlapping keys to the same group of rows.
I've digged around to understand that the problem is that I'm mapping the UserId column twice: once for the discriminator condition and second for the association.
Am I right with my assumption? -Can I get this thing to work?
Thanks, Nir.