﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Ayende Rahien commented on Efficently loading deep object graphs</title><description>Allen,
  
That is something that I added to NHibernate, Hibernate has no equivalent that I know of
</description><link>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment12</link><guid>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment12</guid><pubDate>Thu, 05 Jul 2007 20:59:29 GMT</pubDate></item><item><title>Allen commented on Efficently loading deep object graphs</title><description>I'm wondering what is the Hibernate equivalent syntax for achieving this since there's no CreateMultiQuery() function?
</description><link>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment11</link><guid>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment11</guid><pubDate>Thu, 05 Jul 2007 20:40:45 GMT</pubDate></item><item><title>Ayende Rahien commented on Efficently loading deep object graphs</title><description>Yes, it should be
</description><link>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment10</link><guid>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment10</guid><pubDate>Sat, 30 Jun 2007 16:50:48 GMT</pubDate></item><item><title>Jim Geurts commented on Efficently loading deep object graphs</title><description>I may be mistaken, but shouldn't the line:
  
  
.SetEntity("policy", Policy)
  
  
be
  
  
.SetInt32("policyId", policyId)
</description><link>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment9</link><guid>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment9</guid><pubDate>Sat, 30 Jun 2007 16:10:32 GMT</pubDate></item><item><title>Ayende Rahien commented on Efficently loading deep object graphs</title><description>@ Florent,
  
Yes, that would be faster, but the key part here is that it is 5 request, but a SINGLE round trip
</description><link>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment8</link><guid>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment8</guid><pubDate>Thu, 21 Jun 2007 09:57:22 GMT</pubDate></item><item><title>Florent Dugue commented on Efficently loading deep object graphs</title><description>Ok, if I understand well, you mean it's faster to do 5 requests with only one join between two tables in each request instead of one big request between the 6 tables ?
  
  
BTW, I forgot the .Add(new EqExpression("Id", policyId)) between CreateCritera and the first SetFetchMode for removing the Cartesian product.
  
  
@Sven : yeah, damn fast ! ;)
</description><link>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment7</link><guid>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment7</guid><pubDate>Thu, 21 Jun 2007 09:08:46 GMT</pubDate></item><item><title>Sven commented on Efficently loading deep object graphs</title><description>Damn, he's just too quick, isn't he ?  :-)
</description><link>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment6</link><guid>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment6</guid><pubDate>Thu, 21 Jun 2007 08:57:59 GMT</pubDate></item><item><title>Sven commented on Efficently loading deep object graphs</title><description>Florent, I'm guessing what you wrote would cause the huge cartesian product Ayende mentioned.
</description><link>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment5</link><guid>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment5</guid><pubDate>Thu, 21 Jun 2007 08:56:48 GMT</pubDate></item><item><title>Ayende Rahien commented on Efficently loading deep object graphs</title><description>This will return a single result set.
  
The problem with that is that if you try to load all of that in a single result set, you will have a big Cartesian product.
  
The approach above uses separate queries, but only a single round trip
</description><link>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment4</link><guid>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment4</guid><pubDate>Thu, 21 Jun 2007 08:55:26 GMT</pubDate></item><item><title>Florent Dugue commented on Efficently loading deep object graphs</title><description>Sorry for my ignorance, but what's the difference with adding "SetFetchMode" ?
  
  
IList list = Session.CreateCriteria(typeof (Policy ))
  
                .SetFetchMode("PolicyLeadAssociations", FetchMode.Join)
  
                .SetFetchMode("PolicyEmployeeAssociations", FetchMode.Join)
  
                .SetFetchMode("PolicyManagerAssociations", FetchMode.Join)
  
                .SetFetchMode("PolicyDepartmentAssociations", FetchMode.Join)
  
                .SetFetchMode("PolicyCustomerAssociations", FetchMode.Join)
  
                .List();
</description><link>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment3</link><guid>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment3</guid><pubDate>Thu, 21 Jun 2007 08:53:37 GMT</pubDate></item><item><title>Ayende Rahien commented on Efficently loading deep object graphs</title><description>I mean, that is one option that you have, yes.
</description><link>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment2</link><guid>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment2</guid><pubDate>Wed, 20 Jun 2007 21:07:49 GMT</pubDate></item><item><title>Frans Bouma commented on Efficently loading deep object graphs</title><description>You mean... there are o/r mappers out there which fetch graphs using cartesian products? :X
  
  
Ugh...
</description><link>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment1</link><guid>http://ayende.com/2580/efficently-loading-deep-object-graphs#comment1</guid><pubDate>Wed, 20 Jun 2007 21:01:20 GMT</pubDate></item></channel></rss>