I habe a problem with a old table that I want to map to a ECO class:
The problem is that the table has no unique primary key (so actually it's a wrongly modeled table) but I want/have to map it now. I would be fine if following could be possible:Attribute 1 contains a ID but is not unique, some IDs can be found several times.
Attribute 2 contains a foreign ID but also can contain null.
I could model a class for those rows where Attribute 2 is null (only Attribute 1 as PK and this is unique) and a second class for those rows where Attribute 2 is not null. Then the combined key (Attribute 1 and Attribute 2 as PK) is unique.
Is there any document that explains such mappings (custom OR-mapping with inheritance with usage of type discriminators). Can the type discriminator technique recognize a type on a null value of a attribute?