<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Table Inheritance</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Table Inheritance</description>
  <pubDate>Wed, 10 Jun 2026 19:11:18 -700</pubDate>
  <lastBuildDate>Mon, 20 Sep 2010 15:46:35 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=2154</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Table Inheritance : Kim - Thank you! I&amp;#039;ll see...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2154&amp;PID=8576#8576</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=704" rel="nofollow">mikewishart</a><br /><strong>Subject:</strong> 2154<br /><strong>Posted:</strong> 20-Sep-2010 at 3:46pm<br /><br />Kim - Thank you!&nbsp; I'll see if we go that route.<br><br>Markus,<br><br>As I understand it, this is what you're looking for in EDMX.<br><br><img src="uploads/704/em.JPG" height="295" width="514" border="0" /><br>Your physical database needs a table between Student and Class and needs to look like this.<br><br><img src="uploads/704/Phys.JPG" height="229" width="859" border="0" /><br><br>Once I built the data schema then imported all 5 tables into the EDMX, it worked just fine.&nbsp; Of course I had to delete the FK relationships between Person-Teacher and Person-Student and delete the PersonId on Student and Teacher.<br><br><br><br><span style="font-size:10px"><br /><br />Edited by mikewishart - 20-Sep-2010 at 3:57pm</span>]]>
   </description>
   <pubDate>Mon, 20 Sep 2010 15:46:35 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2154&amp;PID=8576#8576</guid>
  </item> 
  <item>
   <title>Table Inheritance : I am trying to do the following...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2154&amp;PID=8566#8566</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=945" rel="nofollow">mseeli</a><br /><strong>Subject:</strong> 2154<br /><strong>Posted:</strong> 20-Sep-2010 at 6:36am<br /><br />I am trying to do the following using inheritance (table by hierarchy):<DIV>&nbsp;</DIV><DIV>I have a Person and derived from that two Subclasses:&nbsp; Student and Teacher</DIV><DIV>&nbsp;</DIV><DIV>Now I have a further class called Class with an association between Student and Class (i.e. a Student belongs to a Class, a Class has many Students in it but a Teacher is not in a Class.</DIV><DIV>&nbsp;</DIV><DIV>So the navigational property from StudentToClass should be on the Student but not on Person or Teacher.</DIV><DIV>&nbsp;</DIV><DIV>I have tried for hours to get the mapping to work but I could not get it to work.</DIV><DIV>&nbsp;</DIV><DIV>Is what I am trying possible or does DefForce not support what I am trying to achieve?</DIV><DIV>&nbsp;</DIV><DIV>Markus Seeli</DIV>]]>
   </description>
   <pubDate>Mon, 20 Sep 2010 06:36:15 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2154&amp;PID=8566#8566</guid>
  </item> 
  <item>
   <title>Table Inheritance : I don&amp;#039;t have a good answer...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2154&amp;PID=8507#8507</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 2154<br /><strong>Posted:</strong> 14-Sep-2010 at 7:31pm<br /><br />I don't have a good answer for the LastUpdateTime columns.&nbsp; That might be a good question for the EF forum&nbsp;on MSDN (I'm really not trying to dodge the question, but best to ask the experts)&nbsp; - <a href="http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/threads/" target="_blank">http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/threads/</A><DIV>&nbsp;</DIV><DIV>You shouldn't have a problem with an ExecuteSave override, unless you're really trying to take control of the save process, which you shouldn't.&nbsp; &nbsp;You'll be able to retrieve entities OfType&lt;Person&gt; or OfType&lt;Employee&gt; and work with them as you normally would.&nbsp; The one thing that can sometimes be confusing when working with inherited entities is that the EntityQuery auto-generated on your EntityManager will return entities of the type and all base types, so&nbsp;entityManager.Persons will return any type of person.</DIV>]]>
   </description>
   <pubDate>Tue, 14 Sep 2010 19:31:17 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2154&amp;PID=8507#8507</guid>
  </item> 
  <item>
   <title>Table Inheritance : Thanks! We&amp;#039;re looking at...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2154&amp;PID=8504#8504</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=704" rel="nofollow">mikewishart</a><br /><strong>Subject:</strong> 2154<br /><strong>Posted:</strong> 14-Sep-2010 at 5:16pm<br /><br />Thanks!&nbsp; We're looking at a Table-per-Type architecture here.<br><br>Kim, your second link was extremely helpful and almost got it.&nbsp; I was missing the step of deleting the primary key columns from the mapping on the inherited tables.<br><br>One more item to stump me.&nbsp; If we have a common column between the two tables, say something we use for replication (eg. LastUpdateTime), it can certainly be the same value in both tables, but I don't see any way to map the property mapping in the descendant table to the parent table.&nbsp; I suppose I can rename it (LastUpdateTimeTPT) and set it to the same value and change its setter/getter to private, but that's not the most perfect solution. If that's what I need to do, then I'll look at that.<br><br>Looking ahead a bit.&nbsp; When I get to the EntityServerSaveInterceptor.ExecuteSave(), should I be concerned about anything. Any pitfalls here?<br><br>Thanks again!<br>Mike<br>]]>
   </description>
   <pubDate>Tue, 14 Sep 2010 17:16:49 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2154&amp;PID=8504#8504</guid>
  </item> 
  <item>
   <title>Table Inheritance : We don&amp;#039;t currently have any...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2154&amp;PID=8502#8502</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 2154<br /><strong>Posted:</strong> 14-Sep-2010 at 4:12pm<br /><br />We don't currently have any samples in the DevForce Resource Center showing inheritance, but we should have some samples lying around which we can send you.&nbsp; The BaseType isn't new, since inheritance was supported in EF v1, and by extension DevForce.&nbsp; We support everything EF does regarding the three "flavors" of inheritance based on your DB schema:&nbsp; Table per Type (TPT), Table per Hierarchy (TPH) and Table per Concrete type (TPC).&nbsp;&nbsp; These all expect the PK to be the same, so I'm not sure if you're running into a problem or just working through the design conceptually.&nbsp;&nbsp; <DIV>&nbsp;</DIV><DIV>I'm trying to find a good inheritance write up from Microsoft and not seeing much, but here are a few links to provide an overview:</DIV><DIV><a href="http://blogs.msdn.com/b/alexj/archive/2009/04/15/tip-12-choosing-an-inheritance-strategy.aspx?CommentPosted=true" target="_blank">http://blogs.msdn.com/b/alexj/archive/2009/04/15/tip-12-choosing-an-inheritance-strategy.aspx?CommentPosted=true</A></DIV><DIV><a href="http://www.robbagby.com/entity-framework/entity-framework-modeling-table-per-type-inheritance/" target="_blank">http://www.robbagby.com/entity-framework/entity-framework-modeling-table-per-type-inheritance/</A></DIV><DIV><a href="http://www.robbagby.com/entity-framework/entity-framework-modeling-table-per-hierarchy-inheritance/" target="_blank">http://www.robbagby.com/entity-framework/entity-framework-modeling-table-per-hierarchy-inheritance/</A></DIV><DIV>&nbsp;</DIV><DIV>If you'd like a sample showing a specific flavor of inheritance just let us know.</DIV>]]>
   </description>
   <pubDate>Tue, 14 Sep 2010 16:12:42 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2154&amp;PID=8502#8502</guid>
  </item> 
  <item>
   <title>Table Inheritance : My other suggestion is to look...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2154&amp;PID=8497#8497</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2154<br /><strong>Posted:</strong> 14-Sep-2010 at 12:46pm<br /><br /><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">My other suggestion is to look at our PropertyInterceptors and see if it can help you do what you're trying to achieve.<div><br></div><div>PropertyInterceptors are "<span apple-style-span="Apple-style-span" style="font-family: sans-serif; line-height: 19px; font-size: 14px; ">is intended to replace, and expand upon, the technique of marking properties as virtual and overriding them in a subclass".</span></div><div><span apple-style-span="Apple-style-span" style="font-family: sans-serif; line-height: 19px; font-size: 14px; "><br></span></div><div><span apple-style-span="Apple-style-span" style="font-family: sans-serif; line-height: 19px; font-size: 14px; "><a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/UsingPropertyInterceptors" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/UsingPropertyInterceptors</a></span></div></span>]]>
   </description>
   <pubDate>Tue, 14 Sep 2010 12:46:49 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2154&amp;PID=8497#8497</guid>
  </item> 
  <item>
   <title>Table Inheritance : Hi Mike;Overriding a property...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2154&amp;PID=8493#8493</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2154<br /><strong>Posted:</strong> 14-Sep-2010 at 11:58am<br /><br /><div style=": rgb255, 255, 255; margin-left: 1px; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; font-family: Verdana, Arial, Helvetica, sans-serif; color: rgb0, 0, 0; font-weight: normal; font-size: 12px; line-height: 1.4; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; -: n&#111;ne; ">Hi Mike;<div><br></div><div>Overriding a property of a generated DevForce entity via standard code generation is not possible. You might be able to do it by implementing a custom .tt template but other DevForce features might break.</div></div>]]>
   </description>
   <pubDate>Tue, 14 Sep 2010 11:58:40 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2154&amp;PID=8493#8493</guid>
  </item> 
  <item>
   <title>Table Inheritance : Is there an example of how to...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2154&amp;PID=8479#8479</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=704" rel="nofollow">mikewishart</a><br /><strong>Subject:</strong> 2154<br /><strong>Posted:</strong> 13-Sep-2010 at 2:37pm<br /><br />Is there an example of how to use the (new?) "Base Type" property for an entity?<br><br>We're trying to do something along the lines of:<br><u><br>Person</u><br>(pk)PersonId<br>Name<br>Address<br>City<br><br><u>Employee</u> -&gt; <i>Person</i><br>(pk)PersonId<br>StartDate<br>Status<br><br>I can't see how to get around the Employee having the same primary key as the Person if you set Person as the base type for Employee.&nbsp; The Employee table requires the field for the relationship to work.<br><br>Thanks!<br>]]>
   </description>
   <pubDate>Mon, 13 Sep 2010 14:37:18 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2154&amp;PID=8479#8479</guid>
  </item> 
 </channel>
</rss>