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 18:17:27 GMT
On Thu, Nov 5, 2009 at 12:52 PM, Michael Dick <michael.d.dick@gmail.com>wrote:

> Can you give the 1.2.x patch attached to OPENJPA-894 a try? There are some
> limitations with the approach I took (ie if Large Result Sets are used),
> but
> it'd be nice to know whether it works for you.
>

I'm pretty strapped for time, but I'll try to squeeze it in.

LEFT JOINS should behave the same way..


I was originally under the impression that JOIN FETCH was somehow different
from a JOIN from an SQL/DB perspective, perhaps because of the bug. If the
duplicates were returned, exactly how is JOIN different than JOIN FETCH? The
latter returns the parent duplicated for each child along with each child
AND populates each parent with the set of children? What is the difference
between

select o from A as o
join o.bCol as bCol

and

select o from A as o
join fetch o.bCol

assuming duplicate bug is fixed?



> In OpenJPA 1.2.1 if you want the duplicate references in your result list
> then you're mostly out of luck.


Fortunately I don't. But I don't want them to show up later because I forgot
the "DISTINCT" keyword...


> One ugly way to get them is to run the query
> twice (the second time we operate in memory and return the correct
> results).
> If you don't want duplicate references then I _think_ it works out of the
> box (until you run the query in memory . . .).
>

Meaning without the DISTINCT keyword? I should not get the duplicates now or
in the future (after bugs fixed) if I include DISTINCT, right (assuming
simple "select distinct o from A as o left join fetch o.bCol")?

-- 
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