<?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: Don&#039;t Forget Inverse=&quot;true&quot;!</title>
	<atom:link href="http://www.barneyb.com/barneyblog/2010/04/09/dont-forget-inverse-true/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.barneyb.com/barneyblog/2010/04/09/dont-forget-inverse-true/</link>
	<description>Thoughts, rants, and even some code from the mind of Barney Boisvert.</description>
	<lastBuildDate>Thu, 11 Sep 2014 09:58:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Pritesh</title>
		<link>https://www.barneyb.com/barneyblog/2010/04/09/dont-forget-inverse-true/comment-page-1/#comment-536111</link>
		<dc:creator>Pritesh</dc:creator>
		<pubDate>Wed, 18 Jun 2014 14:52:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1473#comment-536111</guid>
		<description>Detail explanation. Thanks for your all effort.</description>
		<content:encoded><![CDATA[<p>Detail explanation. Thanks for your all effort.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lokesh Guru</title>
		<link>https://www.barneyb.com/barneyblog/2010/04/09/dont-forget-inverse-true/comment-page-1/#comment-381043</link>
		<dc:creator>Lokesh Guru</dc:creator>
		<pubDate>Tue, 04 Jun 2013 10:44:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1473#comment-381043</guid>
		<description>Great post. After searching a lot ,Now i am able to understand it correctly. 
Thanx. Keep doing good work.</description>
		<content:encoded><![CDATA[<p>Great post. After searching a lot ,Now i am able to understand it correctly.<br />
Thanx. Keep doing good work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: barneyb</title>
		<link>https://www.barneyb.com/barneyblog/2010/04/09/dont-forget-inverse-true/comment-page-1/#comment-315237</link>
		<dc:creator>barneyb</dc:creator>
		<pubDate>Mon, 25 Jun 2012 20:02:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1473#comment-315237</guid>
		<description>Eric,

The Adobe docs are horribly confusing.  The next sentence after the one you quoted is &quot;For example, in ARTIST-ART relation, inverse should be set to true on the &#039;art&#039; property in ARTIST.&quot;  As you would certainly agree, in the ARTIST-ART association, the ARTIST is the &quot;one&quot; side and that&#039;s where they say you should set inverse=&quot;true&quot;.

For some reason they are trying to use &quot;one&quot; and &quot;many&quot; to reference the multiplicity of the property, rather than the number of objects.  Still using ARTIST-ART, there is one ARTIST and many ARTs.  The ART-to-ARTIST association is one-to-many.  The inverse (ARTIST-to-ART) is many-to-one.  However, the &#039;art&#039; property on the ARTIST object is a collection.

Put in simpler terms, in a one-to-many relationship, the &quot;one&quot; side has a collection property and the &quot;many&quot; side has a non-collection property.  Adobe is recommending the same thing, placing it on the &quot;one&quot; side (the side with the collection property).  Why they have opted to use such counter-intuitive wording I have no idea.</description>
		<content:encoded><![CDATA[<p>Eric,</p>
<p>The Adobe docs are horribly confusing.  The next sentence after the one you quoted is "For example, in ARTIST-ART relation, inverse should be set to true on the 'art' property in ARTIST."  As you would certainly agree, in the ARTIST-ART association, the ARTIST is the "one" side and that's where they say you should set inverse="true".</p>
<p>For some reason they are trying to use "one" and "many" to reference the multiplicity of the property, rather than the number of objects.  Still using ARTIST-ART, there is one ARTIST and many ARTs.  The ART-to-ARTIST association is one-to-many.  The inverse (ARTIST-to-ART) is many-to-one.  However, the 'art' property on the ARTIST object is a collection.</p>
<p>Put in simpler terms, in a one-to-many relationship, the "one" side has a collection property and the "many" side has a non-collection property.  Adobe is recommending the same thing, placing it on the "one" side (the side with the collection property).  Why they have opted to use such counter-intuitive wording I have no idea.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Pierce</title>
		<link>https://www.barneyb.com/barneyblog/2010/04/09/dont-forget-inverse-true/comment-page-1/#comment-315232</link>
		<dc:creator>Eric Pierce</dc:creator>
		<pubDate>Mon, 25 Jun 2012 19:40:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1473#comment-315232</guid>
		<description>From the CF 9 ORM docs:
&quot;For one-to-many or many-to-one relation, inverse should be set on the many side of the relation.&quot;

That&#039;s the exact opposite side of the relationship that you&#039;re suggesting.   Did you have any experiences which drove your personal preference for putting &#039;inverse&#039; on the &#039;one&#039; side of the relationship?

Thanks,
Eric P.

Ref. http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WS5FFD2854-7F18-43ea-B383-161E007CE0D1.html</description>
		<content:encoded><![CDATA[<p>From the CF 9 ORM docs:<br />
"For one-to-many or many-to-one relation, inverse should be set on the many side of the relation."</p>
<p>That's the exact opposite side of the relationship that you're suggesting.   Did you have any experiences which drove your personal preference for putting 'inverse' on the 'one' side of the relationship?</p>
<p>Thanks,<br />
Eric P.</p>
<p>Ref. <a href="http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WS5FFD2854-7F18-43ea-B383-161E007CE0D1.html" rel="nofollow">http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WS5FFD2854-7F18-43ea-B383-161E007CE0D1.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Messina</title>
		<link>https://www.barneyb.com/barneyblog/2010/04/09/dont-forget-inverse-true/comment-page-1/#comment-226710</link>
		<dc:creator>Chris Messina</dc:creator>
		<pubDate>Fri, 19 Nov 2010 19:54:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1473#comment-226710</guid>
		<description>barneyb,

I wanted to make a slight correction to your comment &quot;It&#039;s completely irrelevant which side you set it on. It just has to be set somewhere so that Hibernate only persists in one direction.&quot;

I believe that it is not completely irrelevant. I think setting inverse=&quot;true&quot; on the wrong side will lead to less efficient database calls.</description>
		<content:encoded><![CDATA[<p>barneyb,</p>
<p>I wanted to make a slight correction to your comment "It's completely irrelevant which side you set it on. It just has to be set somewhere so that Hibernate only persists in one direction."</p>
<p>I believe that it is not completely irrelevant. I think setting inverse="true" on the wrong side will lead to less efficient database calls.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abderraouf Allani</title>
		<link>https://www.barneyb.com/barneyblog/2010/04/09/dont-forget-inverse-true/comment-page-1/#comment-226570</link>
		<dc:creator>Abderraouf Allani</dc:creator>
		<pubDate>Thu, 18 Nov 2010 11:28:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1473#comment-226570</guid>
		<description>Thanks! :-)</description>
		<content:encoded><![CDATA[<p>Thanks! :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>https://www.barneyb.com/barneyblog/2010/04/09/dont-forget-inverse-true/comment-page-1/#comment-210326</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Thu, 15 Apr 2010 18:00:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1473#comment-210326</guid>
		<description>Thanks for the mailing list. My post is here if anyone is interested:
http://groups.google.com/group/cf-orm-dev/browse_thread/thread/d4255ceb792236e8#

Sorry to be spamming your comments Barney! Again, thanks for your help!</description>
		<content:encoded><![CDATA[<p>Thanks for the mailing list. My post is here if anyone is interested:<br />
<a href="http://groups.google.com/group/cf-orm-dev/browse_thread/thread/d4255ceb792236e8#" rel="nofollow">http://groups.google.com/group/cf-orm-dev/browse_thread/thread/d4255ceb792236e8#</a></p>
<p>Sorry to be spamming your comments Barney! Again, thanks for your help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: barneyb</title>
		<link>https://www.barneyb.com/barneyblog/2010/04/09/dont-forget-inverse-true/comment-page-1/#comment-210321</link>
		<dc:creator>barneyb</dc:creator>
		<pubDate>Thu, 15 Apr 2010 16:38:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1473#comment-210321</guid>
		<description>Dave,

Not to push you off, but I think it&#039;s time this migrate to the cf-orm-dev mailing list (http://groups.google.com/group/cf-orm-dev).  That&#039;ll be a much better format discussing a specific issue like this.  When you post, make sure you include the property definitions of your entities, along with your helper methods.  Without those it&#039;s hard to say what&#039;s happening.</description>
		<content:encoded><![CDATA[<p>Dave,</p>
<p>Not to push you off, but I think it's time this migrate to the cf-orm-dev mailing list (<a href="http://groups.google.com/group/cf-orm-dev" rel="nofollow">http://groups.google.com/group/cf-orm-dev</a>).  That'll be a much better format discussing a specific issue like this.  When you post, make sure you include the property definitions of your entities, along with your helper methods.  Without those it's hard to say what's happening.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>https://www.barneyb.com/barneyblog/2010/04/09/dont-forget-inverse-true/comment-page-1/#comment-210310</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Thu, 15 Apr 2010 14:43:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1473#comment-210310</guid>
		<description>I have a Forum with many Posts, in a bidirectional relationship. I perform the following code:

                oForum = entityNew(&quot;Forum&quot;);
		oPost = entityNew(&quot;Post&quot;);
		
                oForum.addPost(oPost);
		oPost.setForum(oForum);
		
		writeOutput(&quot;oForum.hasPost(oPost): &quot; &amp; oForum.hasPost(oPost));
		writeOutput(&quot;oPost.hasForum(oForum): &quot; &amp; oPost.hasForum(oForum));
		
		EntitySave(oForum);
		EntitySave(oPost);

These are the results:
oForum.hasPost(oPost): YES
oPost.hasForum(oForum): NO

The ForumID is saved correctly to the Post table, but I can never get a Post to see it&#039;s parent Forum in the same request, even with an association management method (gets worse, they both result in NO). I thought this wouldn&#039;t be an issue if I set the relationship both ways??? Very frustrating.</description>
		<content:encoded><![CDATA[<p>I have a Forum with many Posts, in a bidirectional relationship. I perform the following code:</p>
<p>                oForum = entityNew("Forum");<br />
		oPost = entityNew("Post");</p>
<p>                oForum.addPost(oPost);<br />
		oPost.setForum(oForum);</p>
<p>		writeOutput("oForum.hasPost(oPost): " &amp; oForum.hasPost(oPost));<br />
		writeOutput("oPost.hasForum(oForum): " &amp; oPost.hasForum(oForum));</p>
<p>		EntitySave(oForum);<br />
		EntitySave(oPost);</p>
<p>These are the results:<br />
oForum.hasPost(oPost): YES<br />
oPost.hasForum(oForum): NO</p>
<p>The ForumID is saved correctly to the Post table, but I can never get a Post to see it's parent Forum in the same request, even with an association management method (gets worse, they both result in NO). I thought this wouldn't be an issue if I set the relationship both ways??? Very frustrating.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>https://www.barneyb.com/barneyblog/2010/04/09/dont-forget-inverse-true/comment-page-1/#comment-210278</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Wed, 14 Apr 2010 22:34:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1473#comment-210278</guid>
		<description>Even with the above logic, I get a &quot;javax.servlet.ServletException&quot; error when I put the association management method on both sides of the relationship, which is probably from recursion.

So now I have to figure out which side should get this association management method. Maybe it&#039;s the side that has inverse=&quot;true&quot;?</description>
		<content:encoded><![CDATA[<p>Even with the above logic, I get a "javax.servlet.ServletException" error when I put the association management method on both sides of the relationship, which is probably from recursion.</p>
<p>So now I have to figure out which side should get this association management method. Maybe it's the side that has inverse="true"?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
