<?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 : One-to-many and one-to-one association between the same entities</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : One-to-many and one-to-one association between the same entities</description>
  <pubDate>Thu, 14 May 2026 01:38:43 -700</pubDate>
  <lastBuildDate>Fri, 24 Jun 2011 14:50:50 -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=2787</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>One-to-many and one-to-one association between the same entities :   Hi Silvio,Thanks for your...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2787&amp;PID=11105#11105</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1112" rel="nofollow">samir</a><br /><strong>Subject:</strong> 2787<br /><strong>Posted:</strong> 24-Jun-2011 at 2:50pm<br /><br />Hi Silvio,<div>&nbsp;</div><div>Thanks for your suggestion, it works!</div><div>The problem I´m facing now is that I can´t save both a Father and his favorite Child in the same operation as I get a "Unable to determine a valid ordering for dependent operations" -&nbsp;which is understandable. Is there any work-around on the server side for this? I really wouldn´t like to first save the Father and then (after Father has its final Id) save&nbsp;it´s favorite Child.</div><div>&nbsp;</div><div>Thanks,</div><div>Samir</div>]]>
   </description>
   <pubDate>Fri, 24 Jun 2011 14:50:50 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2787&amp;PID=11105#11105</guid>
  </item> 
  <item>
   <title>One-to-many and one-to-one association between the same entities :   Hi Samir, Thanks for clarifying....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2787&amp;PID=11086#11086</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2787<br /><strong>Posted:</strong> 23-Jun-2011 at 1:36pm<br /><br />Hi Samir,<div> </div><div>Thanks for clarifying.</div><div> </div><div>The the error you are getting:</div><div>In the 1..1 relation properties add the Referential Constraint. You will need to create a FavoriteChildID foreign key in the Parent entity.</div><div> </div><div>The next problem you would face is that a 1..1 relation will complain if either of the linking FKs are not PKs. </div><div>For this problem, I suggest that instead of using a 1..1 relation, you use a Child 1..* Parent relation instead. The additional step would be removing the 'Fathers' Navigation Property from the Child entity.</div><div> </div><div>Regards,</div><div>   Silvio.</div>]]>
   </description>
   <pubDate>Thu, 23 Jun 2011 13:36:36 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2787&amp;PID=11086#11086</guid>
  </item> 
  <item>
   <title>One-to-many and one-to-one association between the same entities :    Hi Silvio,I think my post&#194;&#180;s...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2787&amp;PID=11068#11068</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1112" rel="nofollow">samir</a><br /><strong>Subject:</strong> 2787<br /><strong>Posted:</strong> 22-Jun-2011 at 6:03am<br /><br />Hi Silvio,<div>&nbsp;</div><div>I think my post´s subject was misleading. The example you provided has a ReportsToEmployeeId that refers to the Id of the same table, however what I want is&nbsp;an hypothetical&nbsp;Father table to have a 1..* relation to a Child table while&nbsp;also having a 1..1 relation to the same&nbsp;Child table.</div><div>&nbsp;</div><div>Here´s the screenshot of what I´d like:</div><div><img src="uploads/1112/devforce.png" height="217" width="523" border="0" /></div><div>&nbsp;</div><div>If&nbsp;I try to build this DevForce throws this:</div><div>&nbsp;</div><div>Error&nbsp;2&nbsp;#error: 'DevForce requires that foreign key columns be included in the model. This must be set when the EDMX is first created. If you are upgrading from DevForce 2009, you cannot use the old model and should recreate it using the Entity Framework for .NET 4.0.&nbsp; The following associations were not set up with foreign key associations enabled: FatherChild1'</div><span style="font-size:10px"><br /><br />Edited by samir - 22-Jun-2011 at 6:04am</span>]]>
   </description>
   <pubDate>Wed, 22 Jun 2011 06:03:25 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2787&amp;PID=11068#11068</guid>
  </item> 
  <item>
   <title>One-to-many and one-to-one association between the same entities :   Hi Samir, If you take a look...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2787&amp;PID=11063#11063</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2787<br /><strong>Posted:</strong> 21-Jun-2011 at 3:33pm<br /><br />Hi Samir, <div>&nbsp;</div><div>If you take a look at the NorthwindIB sample database, you will see that the Employee entity, has this same pattern. (i.e. 1..* and 1..1)</div><div>&nbsp;</div><div>If the above is not enough, what exactly is the issue you are coming across?</div><div>&nbsp;</div><div>Regards, </div><div>&nbsp;&nbsp; Silvio.</div>]]>
   </description>
   <pubDate>Tue, 21 Jun 2011 15:33:16 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2787&amp;PID=11063#11063</guid>
  </item> 
  <item>
   <title>One-to-many and one-to-one association between the same entities :   Hello.I&#194;&#180;m having a hard time...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2787&amp;PID=11062#11062</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1112" rel="nofollow">samir</a><br /><strong>Subject:</strong> 2787<br /><strong>Posted:</strong> 21-Jun-2011 at 3:07pm<br /><br />Hello.<div>I´m having a hard time trying to accomplish the following scenario:</div><div>&nbsp;</div><div>There are&nbsp;two entities: Father and Child.</div><div>Father has a 1 to many association to Child.</div><div>&nbsp;</div><div>I´d like to have a navigation field in Father called PreferredChild which would point to a specific Child. How can I do this with DevForce / Entity Framework?</div>]]>
   </description>
   <pubDate>Tue, 21 Jun 2011 15:07:32 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2787&amp;PID=11062#11062</guid>
  </item> 
 </channel>
</rss>