On Tue, Nov 17, 2009 at 9:27 AM, Michael Simons <[email protected]>wrote:
> You state, that you're query with distinct and join fetch does work > properly. But this would > mean OpenJPA-1365 doesn't occur, does it? > The JIRA states: This issue occurs if the proposed fix for OPENJPA-894 is in place. So 1365 does not occur unless you've patched your code such that 894 is fixed. What version of OpenJPA are you using and do you have any patches in place? > When we call "select a from A a join fetch B" we get n instances of A, with > n = numbers of > A-B-associations. > This is the correct behavior. I have found with OpenJPA 1.2.1, I get distinct rows of A which sounds like what you (and I) want but is improper. 894 shows that a second run of the query in the same EntityManager yields duplicates A's (with LEFT JOIN FETCH). What happens when you do this: select distinct a from A a join fetch a.bs ? How about these two: select a from A a left join fetch a.bs select distinct a from A a left join fetch a.bs I don't want to give the impression that I'm an expert on the matter, just that I've dealt with this issue and I want to be sure my understanding of things is accurate. -- Daryl Stultz _____________________________________ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:[email protected]
