persistence@glassfish.java.net

Re: Issue 2084: Generated SQL uses wrong alias for orderby clause

From: Michael Bouschen <Michael.Bouschen_at_Sun.COM>
Date: Thu, 25 Jan 2007 19:41:53 +0100

Hi Peter,

I checked in the change into the trunk (see
http://fisheye5.cenqua.com/changelog/glassfish/entity-persistence?cs=MAIN:mb124283:20070125165744),

I noticed issue 2084 is on the list of P2 issues that are planned to be
fixed for the beta branch (see email from Mahesh to the glassfish users
alias with subject "Glassfish V2 Milestone 4 done!!"). I think this
needs to be taken to the Bugswat meeting, because any checkin into the
beta branch needs bugswat approval. So I did *not* check it into the
branch and did *not* downgrad the issue to P3.

Peter,
could you please take this to the bugswat meeting? Thanks!

Tom,
I'm off tomorrow. If there is an urgency to have this in the beta
branch, could you please take a look? Thanks!

Regards Michael


> Agreed. good plan.
>
> -----Original Message-----
> From: Tom Ware [mailto:tom.ware_at_oracle.com]
> Sent: Thursday, January 25, 2007 10:13 AM
> To: persistence_at_glassfish.dev.java.net
> Subject: Re: Issue 2084: Generated SQL uses wrong alias for orderby
> clause
>
>
> Hi Michael,
>
> I agree with your plan. We should temporarily disable the change for
> 1519 and then update 2084 and downgrade it to a P3. We can then look at
> 2084 with somewhat less urgency.
>
> The code you have sent looks good. Please feel free to check it in.
>
> -Tom
>
> Michael Bouschen wrote:
>
>
>> Hi Tom,
>>
>> some news about issue 2084 "Generated SQL uses wrong alias for orderby
>> clause" (https://glassfish.dev.java.net/issues/show_bug.cgi?id=2084).
>> Meanwhile there is a forum posting describing the same problem:
>> http://forums.java.net/jive/thread.jspa?threadID=22164&tstart=0
>>
>> I figured out the issue only occurs if the named query is mapped to a
>> ReadAllQuery instance, so the generated SQL is correct when using a
>> ReportQuery. This means my change for 1519 "JPQL: create a ReadAllQuery
>> for simple queries" exposed this problem.
>>
>> I propose I disable the code in the query compiler creating a
>> ReadAllQuery for simple queries. So for the time being the query
>> compiler would always generate a ReportQuery instance for a JPQL SELECT
>> query. Please note, this change allows to run the named query as
>> described in issue 2084, but it does not fix the runtime issue of the
>> invalid SQL for a ReadAllQuery. So I would like to keep 2084 open, but
>> maybe it is ok to downgrade it to a P3.
>>
>> What do you think?
>>
>> Regards Michael
>>
>>
>>