Re: EJBQL and Refreshing Data

2010-05-07 Thread Andrus Adamchik
On May 6, 2010, at 11:53 PM, Andrew Lindesay wrote: Congratulations to you all on getting 3.0 formally released. thanks :-) I have lodged a new ticket "CAY-1427" for this presumed bug below. I see that maybe I could add a unit test into; org.apache.cayenne.ejbql.EJBQLCompiledExp

Re: EJBQL and Refreshing Data

2010-05-06 Thread Andrew Lindesay
Hi Andrus; Congratulations to you all on getting 3.0 formally released. I have lodged a new ticket "CAY-1427" for this presumed bug below. I see that maybe I could add a unit test into; org.apache.cayenne.ejbql.EJBQLCompiledExpressionTest I can't easily see where the "artists and pain

Re: EJBQL and Refreshing Data

2010-05-06 Thread Andrew Lindesay
Hello Andrus; > Hmm, the issue with EJBQL prefetching was fixed some time ago per > https://issues.apache.org/jira/browse/CAY-1366 .. (and we should have unit > tests for it somewhere) Maybe you stumbled on a bug? OK; it is a bit late in the evening here now so I will try to find time to pick

Re: EJBQL and Refreshing Data

2010-05-06 Thread Andrus Adamchik
Also I am not sure about the history of the term, but while spec calls it EJBQL, most implementors call it JPQL, so google may turn out more info on the later term. Andrus On May 6, 2010, at 1:54 PM, Andrus Adamchik wrote: I am using JSR-220 PDF, section 4 as a reference. Not very user fr

Re: EJBQL and Refreshing Data

2010-05-06 Thread Andrus Adamchik
I am using JSR-220 PDF, section 4 as a reference. Not very user friendly, but that's ultimate reference: http://jcp.org/aboutJava/communityprocess/final/jsr220/index.html Hmm, the issue with EJBQL prefetching was fixed some time ago per https://issues.apache.org/jira/browse/CAY-1366 .. (and

Re: EJBQL and Refreshing Data

2010-05-06 Thread Andrew Lindesay
Hi Andrus; Thanks for that –– is there a resource book/web-site/cheat-sheet on EJBQL which you might be able to recommend? My Googling has only really dredged up poor material thus far. I am a new to EJBQL so am not sure on the significance of the "c" in this old query I was running, but addi

Re: EJBQL and Refreshing Data

2010-05-06 Thread Andrus Adamchik
Yes, the syntax is something like this: [LEFT[OUTER]|INNER]JOIN FETCH So you are looking for "LEFT JOIN FETCH", not just "LEFT JOIN". I.e. "FETCH" is what does the prefetching of a relationship, and the rest is specifying the join semantics and can be used with or without prefetching. And

Re: EJBQL and Refreshing Data

2010-05-06 Thread Andrew Lindesay
Hi Andrus; Thanks for the suggestion. I did try that with this; SELECT u FROM FooBar u OUTER JOIN u.someToMany c WHERE u.userType = :userType ORDER BY u.username I get the following exception; Caused by: org.apache.cayenne.ejbql.parser.ParseException: Encountered " "OUTER" "OUTER ""

Re: EJBQL and Refreshing Data

2010-05-06 Thread Andrus Adamchik
IIRC there's also an OUTER fetch join that handles this case. Andrus On May 6, 2010, at 12:26 PM, Andrew Lindesay wrote: Hello Andrey; yeah, you can use fetch joins (since 3.0). something like select f FROM FooBar f inner join fetch f.bars b ... I tried that and it produces a query which e

Re: EJBQL and Refreshing Data

2010-05-06 Thread Andrew Lindesay
Hello Andrey; > yeah, you can use fetch joins (since 3.0). something like > select f FROM FooBar f inner join fetch f.bars b ... I tried that and it produces a query which excludes objects from the result-set where there is nothing in the join. The behaviour of "query.addPrefetch(..)" would be

Re: EJBQL and Refreshing Data

2010-05-06 Thread Andrey Razumovsky
yeah, you can use fetch joins (since 3.0). something like select f FROM FooBar f inner join fetch f.bars b ... 2010/5/6 Andrew Lindesay > Hello; > > If an EJBQL query is performed; > >SELECT f FROM FooBar f WHERE ... > > I note (fairly obvious) that the to-many relationships of the fetch

EJBQL and Refreshing Data

2010-05-05 Thread Andrew Lindesay
Hello; If an EJBQL query is performed; SELECT f FROM FooBar f WHERE ... I note (fairly obvious) that the to-many relationships of the fetch'ed FooBar-s are not freshened. Is there a way to achieve this with an EJBQLQuery as I note there is no; query.addPrefetch(..) Thanks for