cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Zeigler <robert.zeig...@roxanemy.com>
Subject Re: lazy loading (slightly OT)
Date Wed, 28 Mar 2012 15:59:43 GMT
Having dealt with this recently in hibernate...

Hibernate's support for lazy fetching sucks. :) It's there, and it's the default, when possible.
But, for instance, toOne relationships can generally only be lazily fetched if they are also
mandatory (see, eg: https://community.jboss.org/wiki/SomeExplanationsOnLazyLoadingone-to-one).
 As a workaround, the hibernate community suggests mapping the toOne as a toMany and creating
custom getters/setters  (or else build-time instrumentation). 

Every time I'm forced (for client projects) to use hibernate, I find myself wondering how
in the /world/ it /ever/ became the dominant player in the ORM world.

Robert

On Mar 28, 2012, at 3/289:19 AM , Joe Baldwin wrote:

> on the "aside":
> 
> the last time we discussed this, it appears that Hibernate *implements* the rules differently
(and very poorly in my humble opinion), and *so* differently that I would argue that they
don't support it vey well.  The methodologies behind the Cayenne relationship handling are
quite advanced and as "idiot proof" as Java GC.
> 
> 
> On Mar 28, 2012, at 10:04 AM, Durchholz, Joachim wrote:
> 
>>> I think what Michael was saying was, that the answer is that 'lazy loading
>>> of data object relationship data is supported and is the default mechanism'.
>> 
>> That's what I read, too.
>> 
>>> (In fact this is one of the main strengths of Cayenne in my opinion)
>> 
>> On a tangent, I don't think this can be advertised as a special strength of Cayenne.
>> Think about it: Any ORM that does not do by-default lazy association loading will
quickly find itself loading the entire database. If it wasn't built into the ORM right from
the beginning, the ORM is essentially useless and will either die or get that feature added
ASAP.
>> 
>> The more interesting comparison would be how easily an application developer could
specify when to load eagerly.
>> (Not that I'm in a position to actually do such a comparison. ;-) )
> 


Mime
View raw message