<?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 : Cloning an Entity</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Cloning an Entity</description>
  <pubDate>Thu, 11 Jun 2026 07:47:25 -700</pubDate>
  <lastBuildDate>Thu, 20 Mar 2008 11:27:56 -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=731</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>Cloning an Entity : The short answer is that in order...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=731&amp;PID=2721#2721</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=43" rel="nofollow">pkarsh</a><br /><strong>Subject:</strong> 731<br /><strong>Posted:</strong> 20-Mar-2008 at 11:27am<br /><br />The short answer is that in order for the Entity you have created by cloning (aClone in your example) to recognize relational entity objects referenced by dot syntax (e. g. aClone.Address), you have to call AddToManager() on the newly-generated entity.  In your example, before you do the AddToManager you will have to do something to make the primary key of aClone unique.  As it stands, aClone will have the same primary key value as the entity it was cloned from and the AddToManager call will fail.<br />]]>
   </description>
   <pubDate>Thu, 20 Mar 2008 11:27:56 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=731&amp;PID=2721#2721</guid>
  </item> 
  <item>
   <title>Cloning an Entity : I am using the Cabana framework.  ///...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=731&amp;PID=2717#2717</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=136" rel="nofollow">orcities</a><br /><strong>Subject:</strong> 731<br /><strong>Posted:</strong> 19-Mar-2008 at 10:22am<br /><br /><P>I am using the Cabana framework.</P><DIV><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">///</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> </SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">&lt;summary&gt;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">Create clone of this entity; it is associated with but NOT attached to a PM</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">&lt;/summary&gt;<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">///</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> </SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">&lt;remarks&gt;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">///</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> The clone gets its </SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">&lt;see cref="PersistenceManager"/&gt;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> from this entity.<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">///</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> See </SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">&lt;see cref="Clone(PersistenceManager)"/&gt;</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">.<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">///</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> </SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">&lt;/remarks&gt;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">public</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">virtual</SPAN> <SPAN style="COLOR: #2b91af">Entity</SPAN> Clone() {<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">return</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> Clone(PersistenceManager);<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">}<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">public</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">virtual</SPAN> <SPAN style="COLOR: #2b91af">Entity</SPAN> Clone(<SPAN style="COLOR: #2b91af">PersistenceManager</SPAN> pManager) {<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">Entity</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> aClone = pManager.CreateEntity(GetType());<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>aClone.ItemArray = ItemArray;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;</SPAN><SPAN style="COLOR: blue">return</SPAN> aClone;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">}</SPAN></P><FONT size=2></DIV></FONT><DIV>&nbsp;</DIV><DIV>I would think that overriding the associated object would be suffice. But the reference doesn't take.</DIV>]]>
   </description>
   <pubDate>Wed, 19 Mar 2008 10:22:18 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=731&amp;PID=2717#2717</guid>
  </item> 
  <item>
   <title>Cloning an Entity : I meant the code for your Clone...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=731&amp;PID=2716#2716</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=43" rel="nofollow">pkarsh</a><br /><strong>Subject:</strong> 731<br /><strong>Posted:</strong> 19-Mar-2008 at 10:14am<br /><br />I meant the code for your Clone method.  The Entity class does not have a Clone method so you must have added your own Clone method.  Also, in your example, which Entity is the parent and which is the child?<span style="font-size:10px"><br /><br />Edited by pkarsh - 19-Mar-2008 at 10:16am</span>]]>
   </description>
   <pubDate>Wed, 19 Mar 2008 10:14:35 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=731&amp;PID=2716#2716</guid>
  </item> 
  <item>
   <title>Cloning an Entity : Contact-Phone is 1-to-many but...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=731&amp;PID=2713#2713</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=136" rel="nofollow">orcities</a><br /><strong>Subject:</strong> 731<br /><strong>Posted:</strong> 19-Mar-2008 at 8:07am<br /><br />Contact-Phone is 1-to-many but I have examples that are 1-to-1 that do the same thing.]]>
   </description>
   <pubDate>Wed, 19 Mar 2008 08:07:23 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=731&amp;PID=2713#2713</guid>
  </item> 
  <item>
   <title>Cloning an Entity :  Originally posted by orcities Example:  Contact...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=731&amp;PID=2712#2712</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=136" rel="nofollow">orcities</a><br /><strong>Subject:</strong> 731<br /><strong>Posted:</strong> 19-Mar-2008 at 8:05am<br /><br /><DIV><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by orcities</strong></em><br /><br />&nbsp;</DIV><DIV>Example:</DIV><DIV>&nbsp;</DIV><DIV>Contact aClone = aContact.Clone();</DIV><DIV>aClone.Address = SomeAddress;</DIV><DIV></td></tr></table> </DIV><DIV>&nbsp;</DIV><DIV>I have also tried attaching a PM to the clone:</DIV><DIV>Contact aClone = aContact.Clone(MainPM);</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 19 Mar 2008 08:05:22 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=731&amp;PID=2712#2712</guid>
  </item> 
  <item>
   <title>Cloning an Entity : Could you show us your cloning...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=731&amp;PID=2708#2708</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=43" rel="nofollow">pkarsh</a><br /><strong>Subject:</strong> 731<br /><strong>Posted:</strong> 18-Mar-2008 at 3:33pm<br /><br />Could you show us your cloning code?  Also, how is the relation between Contact and Address defined (i. e. 1-to-1 or 1-to-many and who is the parent and who is the child?)<br /><span style="font-size:10px"><br /><br />Edited by pkarsh - 18-Mar-2008 at 3:45pm</span>]]>
   </description>
   <pubDate>Tue, 18 Mar 2008 15:33:08 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=731&amp;PID=2708#2708</guid>
  </item> 
  <item>
   <title>Cloning an Entity : When cloning an entity it only...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=731&amp;PID=2706#2706</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=136" rel="nofollow">orcities</a><br /><strong>Subject:</strong> 731<br /><strong>Posted:</strong> 18-Mar-2008 at 10:47am<br /><br />When cloning an entity it only clones the base entity. When I try and attach to a referenced object it still does not attach. Why is this. <DIV>&nbsp;</DIV><DIV>Example:</DIV><DIV>&nbsp;</DIV><DIV>Contact aClone = aContact.Clone();</DIV><DIV>aClone.Address = SomeAddress;</DIV><DIV>&nbsp;</DIV><DIV>Outcome:</DIV><DIV>aClone.Address still has values that are blank.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><span style="font-size:10px"><br /><br />Edited by orcities - 18-Mar-2008 at 10:47am</span>]]>
   </description>
   <pubDate>Tue, 18 Mar 2008 10:47:13 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=731&amp;PID=2706#2706</guid>
  </item> 
 </channel>
</rss>