persistence@glassfish.java.net

Re: EJBQL: support for fields with a name of a reserved identifier

From: Tom Ware <tom.ware_at_oracle.com>
Date: Tue, 21 Feb 2006 09:14:27 -0500

Hi Michael,

  Sorry for not getting back to you sooner.

<snip>

>> I am starting to think we should be adding regression tests to the
>>entity-persistence-tests suites as we fix these bugs. What do you think?
>>
>>
>
>Yes, I agree. I have a couple of local tests and maybe they should be
>added to the entity-persistence-tests suites. But these tests use their
>own test data, so there is some work to check what data is available and
>adapt the expected result of the new tests.
>
>I know there are some EJBQL tests in the ejbqltesting package. Do they
>include negative tests, I mean a test checking whether the EJBQL
>compiler throws an exception for an invalid query?
>
>Regards Michael
>
>
Adding tests to the entity-persistence tests are a great way to go.
There are a number of models you can use in the test models directory.
I believe most of the EJBQL tests use the 'advanced' model and already
do some data population. If that model is inadequate for your purposes,
it is perfectly ok to either add to that model, or to add your own model.

There are currently very few(or none) negative tests in the ejbql
testing, we have been relying in TCK for these tests so far. This is an
area of the entity-persistence-testing we will have to improve when time
becomes available to do so.

-Tom

>
>
>>-Tom
>>
>>Michael Bouschen wrote:
>>
>>
>>
>>>Hi Tom,
>>>
>>>please have a look at the attached changes of EJBQLParser.g. It allows
>>>to access a field having the same name as an EJBQL keyword, e.g
>>> ... WHERE e.from = :country
>>>
>>>The corresponding glassfish issue is:
>>>https://glassfish.dev.java.net/issues/show_bug.cgi?id=270
>>>
>>>Thanks!
>>>
>>>Regards Michael
>>>
>>>
>>>
>>>

-- 
Tom Ware
Principal Software Engineer
Oracle Canada Inc.
Direct: (613) 783-4598
Email: tom.ware_at_oracle.com