Java Mailing List Archive

http://www.gg3721.com/

Home » users.openjpa »

Re: Multiple SQL select statements for JPQL select with multiple
left join fetch

Pinaki Poddar

2008-08-11

Replies: Find Java Web Hosting

Author LoginPost Reply

Hi,
> SELECT x FROM Magazine x left outer join fetch x.articles left outer join
> fetch x.authors WHERE x.title = 'JDJ'

Yes, OpenJPA will run two parallel queries for this case.
However, the results of the parallel queries are merged. So, for example,
if the database contains a single Magazine with title 'JDJ', the
query.getResultList() will return a list of size 1, though the query will
issue 2 SQL statements. Either of authors or articles of that Magazine
instance can be null but that will not affect the result of the query.
However, as a side-effect of executing the query the associated
authors/articles, if any, will be fetched.

If you are seeing any different behavior, please post an example.

--
Sent from the OpenJPA Users mailing list archive at Nabble.com.

©2008 gg3721.com - Jax Systems, LLC, U.S.A.