<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: ColdFusion ORM : The basics</title>
	<atom:link href="http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/</link>
	<description>My Views on ColdFusion, Java and related technologies</description>
	<lastBuildDate>Mon, 26 Jul 2010 14:26:19 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jim</title>
		<link>http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/comment-page-1/#comment-939</link>
		<dc:creator>Jim</dc:creator>
		<pubDate>Mon, 26 Jul 2010 14:26:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/#comment-939</guid>
		<description>Don,

It sound like you have a many-to-many relationship with a link table between volunteers and organizations.

I don&#039;t know the details, but this can be accomplished.  There is a type of &quot;many-to-many&quot; in your relationship types on the cfproperty tag.  Also, there is a linktable attribute that you use.  So I&#039;m pretty sure it can handle it, you just have to set it up.  Look up many-to-many relationships in the documentation.</description>
		<content:encoded><![CDATA[<p>Don,</p>
<p>It sound like you have a many-to-many relationship with a link table between volunteers and organizations.</p>
<p>I don&#8217;t know the details, but this can be accomplished.  There is a type of &#8220;many-to-many&#8221; in your relationship types on the cfproperty tag.  Also, there is a linktable attribute that you use.  So I&#8217;m pretty sure it can handle it, you just have to set it up.  Look up many-to-many relationships in the documentation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Don</title>
		<link>http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/comment-page-1/#comment-938</link>
		<dc:creator>Don</dc:creator>
		<pubDate>Fri, 23 Jul 2010 19:58:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/#comment-938</guid>
		<description>After extensive googling I have come to the conclusion that ORM can not handle pivot tables.  Thus I still have to know SQL to work with a database and ORM is rapidly becoming useless to me.</description>
		<content:encoded><![CDATA[<p>After extensive googling I have come to the conclusion that ORM can not handle pivot tables.  Thus I still have to know SQL to work with a database and ORM is rapidly becoming useless to me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim</title>
		<link>http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/comment-page-1/#comment-937</link>
		<dc:creator>Jim</dc:creator>
		<pubDate>Wed, 14 Jul 2010 13:10:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/#comment-937</guid>
		<description>The release notes are out for CF 9.0.1 and it does not seem to include a fix for passing null values from Flex to a CF ORM object that I mentioned Feb. 19, above.  Is there a fix for this?  Thanks.</description>
		<content:encoded><![CDATA[<p>The release notes are out for CF 9.0.1 and it does not seem to include a fix for passing null values from Flex to a CF ORM object that I mentioned Feb. 19, above.  Is there a fix for this?  Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Don</title>
		<link>http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/comment-page-1/#comment-936</link>
		<dc:creator>Don</dc:creator>
		<pubDate>Fri, 02 Jul 2010 23:21:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/#comment-936</guid>
		<description>How does ORM handle pivot tables?
I have a table with volunteers, a table of organizations, then a pivot table to match up volunteers to organizations. A volunteer can belong to more than 1 organization.
I&#039;m thinking I have to make an association from volunteers to pivot and pivot to organizations.  Should that work so that when I pull up a volunteer I will see all organizations they belong to and if I pull up an organization I will see all volunteers for that org?</description>
		<content:encoded><![CDATA[<p>How does ORM handle pivot tables?<br />
I have a table with volunteers, a table of organizations, then a pivot table to match up volunteers to organizations. A volunteer can belong to more than 1 organization.<br />
I&#8217;m thinking I have to make an association from volunteers to pivot and pivot to organizations.  Should that work so that when I pull up a volunteer I will see all organizations they belong to and if I pull up an organization I will see all volunteers for that org?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rupesh Kumar</title>
		<link>http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/comment-page-1/#comment-921</link>
		<dc:creator>Rupesh Kumar</dc:creator>
		<pubDate>Mon, 21 Jun 2010 14:59:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/#comment-921</guid>
		<description>Shawn, sorry for the delay in reply. 
If you have set cascade=&quot;save-update&quot; or &quot;all&quot; on the one-to-many relationship, then the EntitySave call on the parent will automatically be cascaded to the child objects. If there is no cascade defined, then you need to call EntitySave on the child objects as well.

p.s : In case you are not aware, there is a google group for CF-ORM at http://groups.google.com/group/cf-orm-dev/ which is quite active and you can ask all your ORM related questions there as well.</description>
		<content:encoded><![CDATA[<p>Shawn, sorry for the delay in reply.<br />
If you have set cascade=&#8221;save-update&#8221; or &#8220;all&#8221; on the one-to-many relationship, then the EntitySave call on the parent will automatically be cascaded to the child objects. If there is no cascade defined, then you need to call EntitySave on the child objects as well.</p>
<p>p.s : In case you are not aware, there is a google group for CF-ORM at <a href="http://groups.google.com/group/cf-orm-dev/" rel="nofollow">http://groups.google.com/group/cf-orm-dev/</a> which is quite active and you can ask all your ORM related questions there as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shawn</title>
		<link>http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/comment-page-1/#comment-918</link>
		<dc:creator>Shawn</dc:creator>
		<pubDate>Tue, 08 Jun 2010 12:51:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/#comment-918</guid>
		<description>Hi Rupesh,

Quick question.... if I have the one-to-many mappings done with inverse set on the child object in the parent, shouldn&#039;t I just be able to do an entitysave on the parent object and let ORM take care of saving the children objects ?    Or do I have to save each child entity separately ?

For example...

cust = EntityNew(&quot;Customer&quot;);
cust.firstname =&#039;Ted&#039;;
cust.lastname=&quot;Williams&#039;;
item1=EntityNew(&quot;Item&quot;);
item1.name=&#039;boots&#039;;

item1.setCust(cust);
cust.addItem(item1);

item2=EntityNew(&quot;Item&quot;);
item2.name=&#039;hat&#039;;

item2.setCust(cust);
cust.addItem(item2);


EntitySave(cust);   
// Will this persist the cust along with the related items to the database ,   or do I have to do a seperate entitysave for each item as well ?</description>
		<content:encoded><![CDATA[<p>Hi Rupesh,</p>
<p>Quick question&#8230;. if I have the one-to-many mappings done with inverse set on the child object in the parent, shouldn&#8217;t I just be able to do an entitysave on the parent object and let ORM take care of saving the children objects ?    Or do I have to save each child entity separately ?</p>
<p>For example&#8230;</p>
<p>cust = EntityNew(&#8221;Customer&#8221;);<br />
cust.firstname =&#8217;Ted&#8217;;<br />
cust.lastname=&#8221;Williams&#8217;;<br />
item1=EntityNew(&#8221;Item&#8221;);<br />
item1.name=&#8217;boots&#8217;;</p>
<p>item1.setCust(cust);<br />
cust.addItem(item1);</p>
<p>item2=EntityNew(&#8221;Item&#8221;);<br />
item2.name=&#8217;hat&#8217;;</p>
<p>item2.setCust(cust);<br />
cust.addItem(item2);</p>
<p>EntitySave(cust);<br />
// Will this persist the cust along with the related items to the database ,   or do I have to do a seperate entitysave for each item as well ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rupesh Kumar</title>
		<link>http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/comment-page-1/#comment-915</link>
		<dc:creator>Rupesh Kumar</dc:creator>
		<pubDate>Mon, 31 May 2010 07:34:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/#comment-915</guid>
		<description>Couple of options
- EntityLoad(&#039;Artist&#039;, {lastName=&quot;blahblah&quot;});
- ORMExecuteQuery(&quot;from Artist where lastName=?&quot;, [lastName]);

Check the documents for EntityLoad and ORMExecuteQuery.</description>
		<content:encoded><![CDATA[<p>Couple of options<br />
- EntityLoad(&#8217;Artist&#8217;, {lastName=&#8221;blahblah&#8221;});<br />
- ORMExecuteQuery(&#8221;from Artist where lastName=?&#8221;, [lastName]);</p>
<p>Check the documents for EntityLoad and ORMExecuteQuery.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Don</title>
		<link>http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/comment-page-1/#comment-913</link>
		<dc:creator>Don</dc:creator>
		<pubDate>Thu, 27 May 2010 22:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/#comment-913</guid>
		<description>How do I do something like get an artist by last name?</description>
		<content:encoded><![CDATA[<p>How do I do something like get an artist by last name?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Lenoir @ Sydney, Australia</title>
		<link>http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/comment-page-1/#comment-841</link>
		<dc:creator>Simon Lenoir @ Sydney, Australia</dc:creator>
		<pubDate>Mon, 29 Mar 2010 23:11:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/#comment-841</guid>
		<description>Thanks for your answer Rupesh. You were right about the alias. Now I&#039;m using Flash Builder Data Services, and most of the code is generated for me based on CF Services... that&#039;s great ! 

Hibernate with ColdFusion for Fhash Remoting is very exiting and state-of-the -art programming !

However I&#039;m running now into the empty array converted to string issue (@Byron)... I guess that it will always happens when an entity.cfc has a one-to-many relations (the one to many relation is an array). As an example ONE Department has Many employees, the Deparment.cfc look like that:

component persistent=&quot;true&quot; table=&quot;department&quot; output=&quot;false&quot; {
property name=&quot;dep_id&quot; column=&quot;dep_id&quot; type=&quot;numeric&quot; ormtype=&quot;int&quot; fieldtype=&quot;id&quot;;
property name=&quot;dep_name&quot; column=&quot;name&quot; type=&quot;string&quot; ormtype=&quot;string&quot;;
property name=&quot;employees&quot; fieldtype=&quot;one-to-many&quot; fkcolumn=&quot;dep_id&quot; cfc=&quot;employe&quot; cascade=&quot;all-delete-orphan&quot;;

If I loadentity the department 1, change his name string property in flex (&quot;IT Department&quot; to &quot;Sales&quot;), and return the result to coldfusion: CF try to deserialize the department, found and empty string employees that should be a null array and display the error message (before entitySave get called)

I didn&#039;t try yet but I guess it has to be handled in Flex, to make sure that an array return as an array... so I guess I should overwrite some action script code generated by flex data services.

Do you think I&#039;m on the good tracks ?

Error Message:
Unable to invoke CFC - coldfusion.runtime.NonArrayException: Object of type class java.lang.String cannot be used as an array
Root cause :org.hibernate.HibernateException: coldfusion.runtime.NonArrayException: Object of type class java.lang.String cannot be used as an array</description>
		<content:encoded><![CDATA[<p>Thanks for your answer Rupesh. You were right about the alias. Now I&#8217;m using Flash Builder Data Services, and most of the code is generated for me based on CF Services&#8230; that&#8217;s great ! </p>
<p>Hibernate with ColdFusion for Fhash Remoting is very exiting and state-of-the -art programming !</p>
<p>However I&#8217;m running now into the empty array converted to string issue (@Byron)&#8230; I guess that it will always happens when an entity.cfc has a one-to-many relations (the one to many relation is an array). As an example ONE Department has Many employees, the Deparment.cfc look like that:</p>
<p>component persistent=&#8221;true&#8221; table=&#8221;department&#8221; output=&#8221;false&#8221; {<br />
property name=&#8221;dep_id&#8221; column=&#8221;dep_id&#8221; type=&#8221;numeric&#8221; ormtype=&#8221;int&#8221; fieldtype=&#8221;id&#8221;;<br />
property name=&#8221;dep_name&#8221; column=&#8221;name&#8221; type=&#8221;string&#8221; ormtype=&#8221;string&#8221;;<br />
property name=&#8221;employees&#8221; fieldtype=&#8221;one-to-many&#8221; fkcolumn=&#8221;dep_id&#8221; cfc=&#8221;employe&#8221; cascade=&#8221;all-delete-orphan&#8221;;</p>
<p>If I loadentity the department 1, change his name string property in flex (&#8221;IT Department&#8221; to &#8220;Sales&#8221;), and return the result to coldfusion: CF try to deserialize the department, found and empty string employees that should be a null array and display the error message (before entitySave get called)</p>
<p>I didn&#8217;t try yet but I guess it has to be handled in Flex, to make sure that an array return as an array&#8230; so I guess I should overwrite some action script code generated by flex data services.</p>
<p>Do you think I&#8217;m on the good tracks ?</p>
<p>Error Message:<br />
Unable to invoke CFC &#8211; coldfusion.runtime.NonArrayException: Object of type class java.lang.String cannot be used as an array<br />
Root cause <img src='http://www.rupeshk.org/blog/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> rg.hibernate.HibernateException: coldfusion.runtime.NonArrayException: Object of type class java.lang.String cannot be used as an array</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rupesh Kumar</title>
		<link>http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/comment-page-1/#comment-838</link>
		<dc:creator>Rupesh Kumar</dc:creator>
		<pubDate>Fri, 26 Mar 2010 11:58:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.rupeshk.org/blog/index.php/2009/07/coldfusion-orm-the-basics/#comment-838</guid>
		<description>@Bryon, Sorry for replying late as I was out of station. 

We know there is an issue when null gets converted to empty string during serialization but it has been like this in CF8 as well. It should not affected your application while upgrading to CF9. Could you provide some more details what exactly broke during upgrade? If you want, you can mail it to me at rukumar at adobe dot com</description>
		<content:encoded><![CDATA[<p>@Bryon, Sorry for replying late as I was out of station. </p>
<p>We know there is an issue when null gets converted to empty string during serialization but it has been like this in CF8 as well. It should not affected your application while upgrading to CF9. Could you provide some more details what exactly broke during upgrade? If you want, you can mail it to me at rukumar at adobe dot com</p>
]]></content:encoded>
	</item>
</channel>
</rss>
