persistence@glassfish.java.net

Re: EJBQL: check SELECT clause requirements for GROUP BY query

From: Michael Bouschen <Michael.Bouschen_at_Sun.COM>
Date: Tue, 28 Feb 2006 16:18:00 +0100

Hi Tom,

thanks! I checked in the change.

Regards Michael

> Hi Michael,
>
> I thought I answered this email yesterday, but it looks like I forgot.
>
> The changes look good. Go ahead with your check-in.
>
> -Tom
>
> Michael Bouschen wrote:
>
>> Hi Tom,
>>
>> today I noticed an oversight in my previous change to check the GROUP
>> BY clause of an EJBQL query. It needs to allow a constructor
>> expression in the SELECT clause of a GROUP BY query. Please have a
>> look at the attached changes. The important ones are in GroupByNode,
>> ConstructorNode and EJBQLExceptionResource.
>>
>> Thanks!
>>
>> Regards Michael
>>
>>
>>
>>> H Tom,
>>>
>>> attached you find my changes to validate the SELECT clause in case of
>>> a GROUP BY query. This makes sure that a GROUP BY query only returns
>>> grouping items or aggregates. The corresponding glassfish issue is:
>>> https://glassfish.dev.java.net/issues/show_bug.cgi?id=166
>>> Please note, the change also includes checking the HAVING expression.
>>> I needed to redefine the getAsString method in a couple of parser
>>> tree nodes in order to give a better error message and might need to
>>> do the same change for more nodes. But this can be added later.
>>>
>>> Thanks!
>>>
>>> Regards Michael
>>>
>>>
>>
>>
>>
>>
>>
>