New Posts New Posts RSS Feed: What is DevForce EF's approach to mapping OO Inheritance?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

What is DevForce EF's approach to mapping OO Inheritance?

 Post Reply Post Reply
Author
sebma View Drop Down
Groupie
Groupie
Avatar

Joined: 19-Aug-2008
Location: Singapore
Posts: 66
Post Options Post Options   Quote sebma Quote  Post ReplyReply Direct Link To This Post Topic: What is DevForce EF's approach to mapping OO Inheritance?
    Posted: 21-Aug-2008 at 11:24pm
Hi All,
Perhaps I have missed some details from DevForce EF documentation, or the Developers Guide in particular.
 
In C#, I hand coded my OO inheritance mapping (Table per Hierarchy way) with class attribute like the following to a database table like:

    [Table(Name="dbo.MyTable")]
    [InheritanceMapping(Code = 1, Type = typeof(MyBase), IsDefault = true)]
    [InheritanceMapping(Code = 2, Type = typeof(MyDerive1))]
    [InheritanceMapping(Code = 3, Type = typeof(MyDerive2))]
    [InheritanceMapping(Code = 4, Type = typeof(MyDerive3))]

Is there a known DevForce EF approach for these O/R impedance mapping?
 
Thanks!
Sebastian
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 24-Aug-2008 at 4:43pm
DevForce EF piggybacks on the inheritance features provided by the Entity Framework data model.  Take a look at http://blogs.msdn.com/adonet/archive/2007/03/15/inheritance-in-the-entity-framework.aspx on the ADO.NET team blog for more information on what can be done in EF. 
 
Although not yet ready as a tutorial, we do have a sample showing models built using TPT (table per type), TPH (table per hierarchy) and TPC (table per concrete type) which is available upon request.  Email support if interested.
Back to Top
sebma View Drop Down
Groupie
Groupie
Avatar

Joined: 19-Aug-2008
Location: Singapore
Posts: 66
Post Options Post Options   Quote sebma Quote  Post ReplyReply Direct Link To This Post Posted: 24-Aug-2008 at 9:11pm
Will email support for sample models, thank-you kimj
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down