openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daryl Stultz <da...@6degrees.com>
Subject Re: Eager fetch leads to out of bounds error
Date Thu, 05 Nov 2009 19:27:23 GMT
On Thu, Nov 5, 2009 at 1:48 PM, Michael Dick <michael.d.dick@gmail.com>wrote:

> On Thu, Nov 5, 2009 at 12:17 PM, Daryl Stultz <daryl@6degrees.com> wrote:
>
>
> I think I misunderstood your point (I thought the FETCH was implied).
>

I think I asked a new question, not necessarily based on your previous
input, so I don't think you misunderstood anything, I just changed the line
of questioning on you. :-)

>
> Adding in the fetch clause:
>
> A JOIN FETCH differs from a JOIN in two ways :
>  * You will get one reference to the entity on the left side of the JOIN
> for every related entity on the right side of the JOIN.
>

This I misunderstood long ago before our discussion - I didn't misunderstand
what you were saying about it. I don't think. Anyway.


>  * The relationship on the right side of the JOIN will be eagerly loaded.
>

This is what I'm having trouble with. If a JOIN would return the children,
isn't it implied that they are eagerly loaded? What exactly does eagerly
loaded mean in this case? Picture this:

select a, bCol.b from A as a
join a.bCol as bCol

compared to this:

select a from A as a
join fetch a.bCol

They both return all the child B entities (same number of "rows") but the
second puts the B's into the appropriate a.bCol collection. In both cases,
B's are being loaded. Is it the bCol collection you are referring to as
being eagerly loaded? Sorry if I'm putting too fine a point on this, just
trying to cement it all in my brain.

-- 
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:daryl@6degrees.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message