CapableObjects forum



custom OR-Mapping with inheritance and discriminators

Posted By Peter Buchmann 2011-09-05 11:06:48
Add to Favorites0
Author Message
Peter Buchmann
 Posted 2011-09-05 11:06:48
Supreme Being

Supreme Being - (1 020 reputation)Supreme Being - (1 020 reputation)Supreme Being - (1 020 reputation)Supreme Being - (1 020 reputation)Supreme Being - (1 020 reputation)Supreme Being - (1 020 reputation)Supreme Being - (1 020 reputation)Supreme Being - (1 020 reputation)Supreme Being - (1 020 reputation)

Group: Forum Members
Last Active: 2 days ago @ 16:47:33
Posts: 158, Visits: 734
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?


Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Back To Top