문제

I have a complex data model (for EF 4.1 code first) that uses composition (many 1-to-1's) to achieve benefits similar to multiple inheritance. But I have a problem to solve, hopefully with mapping.

  1. I need to reduce the number of tables (not entities) to simulate successful multiple inheritance.

  2. I cannot replace the 1-to-1 composition classes with complex types because I will use Dynamic Data as an admin back-end and DD doesn't work with complex types.

  3. Table-per-hierarchy does not seem it would help here because of the simulated multiple inheritance.

  4. Table-per-type would give way too many tables.

I think there is something called "entity splitting". And I think I basically need the opposite of it? I wonder if what I want is even possible... basically simulating complex types by mapping model components more than once.. it sounds impossible. Should I just scrap the composition approach? I could always group properties with attributes or something.

도움이 되었습니까?

해결책

The opposite of entity splitting is called table splitting and it is really possible but it has one big problem happening only in EF code first.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top