<?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 : Many-to-Many table problem</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Many-to-Many table problem</description>
  <pubDate>Thu, 14 May 2026 06:24:14 -700</pubDate>
  <lastBuildDate>Fri, 04 Jan 2008 10:38:53 -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=612</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>Many-to-Many table problem : I guess I really don&amp;#039;t understand...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=612&amp;PID=2361#2361</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 612<br /><strong>Posted:</strong> 04-Jan-2008 at 10:38am<br /><br /><DIV>I guess I really don't understand the issue, then.</DIV><DIV>&nbsp;</DIV><DIV>The sequence number is just a property of the linking object. Why should there be any problem modifying it?&nbsp; It is just like any (non-read-only) property of any object!</DIV><DIV>&nbsp;</DIV><DIV>If you change the value of the SequenceNumber property&nbsp;of existing linking objects; or you add new linking objects; or you delete existing linking objects, no matter: as soon as you ask the User object for its related Roles, you'll get the current list of many-to-many relatives, sorted in the current Sequence order.</DIV><DIV>&nbsp;</DIV><DIV>What am I missing?</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 04 Jan 2008 10:38:53 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=612&amp;PID=2361#2361</guid>
  </item> 
  <item>
   <title>Many-to-Many table problem : Thanks for the response. The...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=612&amp;PID=2358#2358</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=215" rel="nofollow">darbuc</a><br /><strong>Subject:</strong> 612<br /><strong>Posted:</strong> 04-Jan-2008 at 3:00am<br /><br /><P>Thanks for the response.</P><DIV>The challange here is that the "sequence" number can change, or items</DIV><DIV>can be added into the list, which will change the "execute sequence" and the effect of this will have to be cascaded back through the 'join" table.</DIV><DIV>&nbsp;</DIV><DIV>Your example will useful&nbsp;in diplaying &nbsp;the collection in the correct&nbsp;"sequence" number, but being able to modify this number is where I got stuck...</DIV><DIV>&nbsp;</DIV><DIV>Thanks</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 04 Jan 2008 03:00:17 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=612&amp;PID=2358#2358</guid>
  </item> 
  <item>
   <title>Many-to-Many table problem : &amp;gt;&amp;gt; In your examples, one...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=612&amp;PID=2357#2357</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 612<br /><strong>Posted:</strong> 03-Jan-2008 at 5:43pm<br /><br /><P>&gt;&gt; In your examples, one is generally only adding or removing items from the "join-table", not trying to modify this entity.</P><DIV></DIV><DIV></DIV>But realize, every time we add an Order to the Order table, we are, in effect, creating a linking entity between an Employee (acting as SalesRep) and a Customer (who placed the Order). So there's nothing at all unusual or improper about your requirement. The linking entity can have as many properties on it as you need, and can be a meaningful entity in its own right (as is Order).<DIV>&nbsp;</DIV><DIV>Here's a many-to-many Roles property definition that return a user's collection of Roles, sorted in descending order by the Id property of the UserRole (the linking object).&nbsp; (Since I didn't have a SequenceNumber column in my UserRole table, I just used the Id.)</DIV><DIV>&nbsp;</DIV><DIV><FONT size=2><P></FONT><FONT color=#0000ff size=2>public</FONT><FONT size=2> </FONT><FONT color=#2b91af size=2>EntityList</FONT><FONT size=2>&lt;</FONT><FONT color=#2b91af size=2>Role</FONT><FONT size=2>&gt; Roles {</P><P></FONT><FONT color=#0000ff size=2>get</FONT><FONT size=2> {</P><P></FONT><FONT color=#2b91af size=2>ReadOnlyEntityList</FONT><FONT size=2>&lt;</FONT><FONT color=#2b91af size=2>UserRole</FONT><FONT size=2>&gt; userRoles = </FONT><FONT color=#0000ff size=2>base</FONT><FONT size=2>.UserRoles;</P><P>userRoles.ApplySort(</FONT><FONT color=#2b91af size=2>EntityPropertyDescriptors</FONT><FONT size=2>.UserRole.Id.Name,</P><P>System.ComponentModel.</FONT><FONT color=#2b91af size=2>ListSortDirection</FONT><FONT size=2>.Descending, </FONT><FONT color=#0000ff size=2>false</FONT><FONT size=2>);</P><P></FONT><FONT color=#2b91af size=2>EntityList</FONT><FONT size=2>&lt;</FONT><FONT color=#2b91af size=2>Role</FONT><FONT size=2>&gt; roles = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#2b91af size=2>EntityList</FONT><FONT size=2>&lt;</FONT><FONT color=#2b91af size=2>Role</FONT><FONT size=2>&gt;();</P><P></FONT><FONT color=#0000ff size=2>foreach</FONT><FONT size=2> (</FONT><FONT color=#2b91af size=2>UserRole</FONT><FONT size=2> aUserRole </FONT><FONT color=#0000ff size=2>in</FONT><FONT size=2> userRoles) {</P><P>roles.Add(aUserRole.Role);</P><P>}</P><P></FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> roles;</P><P>}</P><P>}</P></FONT></DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Thu, 03 Jan 2008 17:43:22 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=612&amp;PID=2357#2357</guid>
  </item> 
  <item>
   <title>Many-to-Many table problem :   Hi I have a one-to-many relationship...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=612&amp;PID=2212#2212</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=215" rel="nofollow">darbuc</a><br /><strong>Subject:</strong> 612<br /><strong>Posted:</strong> 14-Dec-2007 at 4:58am<br /><br /><FONT size=2><P>&nbsp;</P><P>Hi</P><P>I have a one-to-many relationship that I am trying to implement.(not unlike your User/User Role example)</P><P>The difference being that on the "join table" there is a sequence number, which determines the execute sequence that the items joined by the many-to-many table will need to be executed in.</P><DIV>(this can also be be changed at any time)</DIV><P>I am struggling to work out how to get this to work with ideablade </P><P>In your examples, one is generally only adding or removing items </P><P>from the "join-table", not trying to modify this entity.</P><P>Maybe having the sequnce number on the "join-table" is not</P><P>"best practice". But I'm not quite sure how to best implement</P><P>this requirment.</P><DIV>An example would be, that maybe you want to have a sort-order on UserRoles that diplayed the roles in a particular order. Not just</DIV><DIV>Ascending/Descending.</DIV><DIV>Any suggestions would be appreciated.</DIV><P>Thanks.</P></FONT>]]>
   </description>
   <pubDate>Fri, 14 Dec 2007 04:58:13 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=612&amp;PID=2212#2212</guid>
  </item> 
 </channel>
</rss>