You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Jakob Braeuchi (JIRA)" <ji...@apache.org> on 2006/11/13 21:25:37 UTC

[jira] Created: (OPENJPA-81) Wrong alias used when querying an attribute of a 1:n child

Wrong alias used when querying an attribute of a 1:n child
----------------------------------------------------------

                 Key: OPENJPA-81
                 URL: http://issues.apache.org/jira/browse/OPENJPA-81
             Project: OpenJPA
          Issue Type: Bug
          Components: query
         Environment: openJPA 0.9.7
MySQL 5.0.15
            Reporter: Jakob Braeuchi


the query over the 1:n relationship 'katergorien' 

em.createQuery("select distinct k from KategorieGruppe k " +
            		"where k.kategorien.bezeichnung like ?1 " +
            		"order by k.bezeichnung asc");

uses a wrong alias t2 in the generated SQL:

SELECT DISTINCT t0.id, t0.bezeichnung FROM ekv2kategoriegruppe t0 INNER JOIN ekv2kategorie t1 ON t0.id = t1.idGruppe WHERE (t2.bezeichnung LIKE ? ESCAPE '\\') ORDER BY t0.bezeichnung ASC [params=(String) F%]

Unknown column 't2.bezeichnung' in 'where clause' 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: [jira] Updated: (OPENJPA-81) Bad error message when trying to query a Collection relation using dot notation

Posted by Craig L Russell <Cr...@Sun.COM>.
On Mar 1, 2007, at 7:55 AM, Patrick Linskey wrote:

> My understanding is that "Fix Version(s)" captures both the version  
> that
> something is scheduled to be fixed in (for unresolved issues) and the
> version that something actually was fixed in (for resolved issues).
>
> "Affected Version(s)" identifies the versions that the issue is  
> present
> in.

This is how other projects use these two fields, and seems reasonable  
to me.

>
> So, I spent some time yesterday afternoon doing JIRA triage. My goals
> were to put together something of a reasonable-if-aggressive schedule
> for 0.9.7 (presumably the next release), and to adjust priorities
> according to the JIRA definitions.
>
> As ever, those changes aren't set in stone; they're just what I  
> thought
> looked reasonable.

I agree. It should give us a way to quickly see what remains to be  
done. You can ask JIRA to give you a list of unresolved issues for a  
release.

And when we get closer to a release, we can always remove items that  
seem to be out of scope of the release for whatever reason.

Craig
>
> -Patrick
>
> -- 
> Patrick Linskey
> BEA Systems, Inc.
>
> ______________________________________________________________________ 
> _
> Notice:  This email message, together with any attachments, may  
> contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and   
> affiliated
> entities,  that may be confidential,  proprietary,  copyrighted   
> and/or
> legally privileged, and is intended solely for the use of the  
> individual
> or entity named in this message. If you are not the intended  
> recipient,
> and have received this message in error, please immediately return  
> this
> by email and then delete it.
>
>> -----Original Message-----
>> From: Kevin Sutter [mailto:kwsutter@gmail.com]
>> Sent: Thursday, March 01, 2007 4:55 AM
>> To: open-jpa-dev@incubator.apache.org
>> Subject: Re: [jira] Updated: (OPENJPA-81) Bad error message
>> when trying to query a Collection relation using dot notation
>>
>> Patrick,
>> I'm a little confused with all of these updates you are doing
>> with the JIRA
>> Issues.  Most of the updates are related to specifying a Fix
>> Version of
>> 0.9.7.  Does this mean you are planning on having all of these Issues
>> resolved for 0.9.7?  Or, do you think this field specifies
>> which version
>> needs to be fixed?  There is also an Affected Version field,
>> which in my
>> mind, would more closely relate to that idea.
>>
>> Maybe I'm just not familiar enough with the JIRA usage, but
>> if you could
>> explain the reasoning behind these changes, that would be
>> great.  Thanks.
>>
>> Kevin
>>
>> On 2/28/07, Patrick Linskey (JIRA) <ji...@apache.org> wrote:
>>>
>>>
>>>      [
>>>
>> https://issues.apache.org/jira/browse/OPENJPA-81?page=com.atla
> ssian.jira.plugin.system.issuetabpanels:all-tabpanel]
>>>
>>> Patrick Linskey updated OPENJPA-81:
>>> -----------------------------------
>>>
>>>     Fix Version/s: 0.9.7
>>>
>>>> Bad error message when trying to query a Collection
>> relation using dot
>>> notation
>>>>
>>>
>> --------------------------------------------------------------
>> -----------------
>>>>
>>>>                 Key: OPENJPA-81
>>>>                 URL:
>> https://issues.apache.org/jira/browse/OPENJPA-81
>>>>             Project: OpenJPA
>>>>          Issue Type: Improvement
>>>>          Components: diagnostics, query
>>>>         Environment: openJPA 0.9.7
>>>> MySQL 5.0.15
>>>>            Reporter: Jakob Braeuchi
>>>>            Priority: Minor
>>>>             Fix For: 0.9.7
>>>>
>>>>
>>>> the query over the 1:n relationship 'katergorien'
>>>> em.createQuery("select distinct k from KategorieGruppe k " +
>>>>                       "where k.kategorien.bezeichnung like ?1 " +
>>>>                       "order by k.bezeichnung asc");
>>>> uses a wrong alias t2 in the generated SQL:
>>>> SELECT DISTINCT t0.id, t0.bezeichnung FROM
>> ekv2kategoriegruppe t0 INNER
>>> JOIN ekv2kategorie t1 ON t0.id = t1.idGruppe WHERE
>> (t2.bezeichnung LIKE ?
>>> ESCAPE '\\') ORDER BY t0.bezeichnung ASC [params=(String) F%]
>>>> Unknown column 't2.bezeichnung' in 'where clause'
>>>
>>> --
>>> This message is automatically generated by JIRA.
>>> -
>>> You can reply to this email to add a comment to the issue online.
>>>
>>>
>>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


RE: [jira] Updated: (OPENJPA-81) Bad error message when trying to query a Collection relation using dot notation

Posted by Patrick Linskey <pl...@bea.com>.
BTW, sorry about all the emails. Halfway through my bulk changes, I
realized that I could turn off email spam for bulk changes.

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc. 

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: Kevin Sutter [mailto:kwsutter@gmail.com] 
> Sent: Thursday, March 01, 2007 9:27 AM
> To: open-jpa-dev@incubator.apache.org
> Subject: Re: [jira] Updated: (OPENJPA-81) Bad error message 
> when trying to query a Collection relation using dot notation
> 
> Patrick,
> Sounds good.  I like the aggressive schedule idea.  I hope we 
> can pull it
> off...  :-)
> 
> Kevin
> 
> On 3/1/07, Patrick Linskey <pl...@bea.com> wrote:
> >
> > My understanding is that "Fix Version(s)" captures both the 
> version that
> > something is scheduled to be fixed in (for unresolved 
> issues) and the
> > version that something actually was fixed in (for resolved issues).
> >
> > "Affected Version(s)" identifies the versions that the 
> issue is present
> > in.
> >
> > So, I spent some time yesterday afternoon doing JIRA 
> triage. My goals
> > were to put together something of a 
> reasonable-if-aggressive schedule
> > for 0.9.7 (presumably the next release), and to adjust priorities
> > according to the JIRA definitions.
> >
> > As ever, those changes aren't set in stone; they're just 
> what I thought
> > looked reasonable.
> >
> > -Patrick
> >
> > --
> > Patrick Linskey
> > BEA Systems, Inc.
> >
> > 
> ______________________________________________________________
> _________
> > Notice:  This email message, together with any attachments, 
> may contain
> > information  of  BEA Systems,  Inc.,  its subsidiaries  and 
>  affiliated
> > entities,  that may be confidential,  proprietary,  
> copyrighted  and/or
> > legally privileged, and is intended solely for the use of 
> the individual
> > or entity named in this message. If you are not the 
> intended recipient,
> > and have received this message in error, please immediately 
> return this
> > by email and then delete it.
> >
> > > -----Original Message-----
> > > From: Kevin Sutter [mailto:kwsutter@gmail.com]
> > > Sent: Thursday, March 01, 2007 4:55 AM
> > > To: open-jpa-dev@incubator.apache.org
> > > Subject: Re: [jira] Updated: (OPENJPA-81) Bad error message
> > > when trying to query a Collection relation using dot notation
> > >
> > > Patrick,
> > > I'm a little confused with all of these updates you are doing
> > > with the JIRA
> > > Issues.  Most of the updates are related to specifying a Fix
> > > Version of
> > > 0.9.7.  Does this mean you are planning on having all of 
> these Issues
> > > resolved for 0.9.7?  Or, do you think this field specifies
> > > which version
> > > needs to be fixed?  There is also an Affected Version field,
> > > which in my
> > > mind, would more closely relate to that idea.
> > >
> > > Maybe I'm just not familiar enough with the JIRA usage, but
> > > if you could
> > > explain the reasoning behind these changes, that would be
> > > great.  Thanks.
> > >
> > > Kevin
> > >
> > > On 2/28/07, Patrick Linskey (JIRA) <ji...@apache.org> wrote:
> > > >
> > > >
> > > >      [
> > > >
> > > https://issues.apache.org/jira/browse/OPENJPA-81?page=com.atla
> > ssian.jira.plugin.system.issuetabpanels:all-tabpanel]
> > > >
> > > > Patrick Linskey updated OPENJPA-81:
> > > > -----------------------------------
> > > >
> > > >     Fix Version/s: 0.9.7
> > > >
> > > > > Bad error message when trying to query a Collection
> > > relation using dot
> > > > notation
> > > > >
> > > >
> > > --------------------------------------------------------------
> > > -----------------
> > > > >
> > > > >                 Key: OPENJPA-81
> > > > >                 URL:
> > > https://issues.apache.org/jira/browse/OPENJPA-81
> > > > >             Project: OpenJPA
> > > > >          Issue Type: Improvement
> > > > >          Components: diagnostics, query
> > > > >         Environment: openJPA 0.9.7
> > > > > MySQL 5.0.15
> > > > >            Reporter: Jakob Braeuchi
> > > > >            Priority: Minor
> > > > >             Fix For: 0.9.7
> > > > >
> > > > >
> > > > > the query over the 1:n relationship 'katergorien'
> > > > > em.createQuery("select distinct k from KategorieGruppe k " +
> > > > >                       "where k.kategorien.bezeichnung 
> like ?1 " +
> > > > >                       "order by k.bezeichnung asc");
> > > > > uses a wrong alias t2 in the generated SQL:
> > > > > SELECT DISTINCT t0.id, t0.bezeichnung FROM
> > > ekv2kategoriegruppe t0 INNER
> > > > JOIN ekv2kategorie t1 ON t0.id = t1.idGruppe WHERE
> > > (t2.bezeichnung LIKE ?
> > > > ESCAPE '\\') ORDER BY t0.bezeichnung ASC [params=(String) F%]
> > > > > Unknown column 't2.bezeichnung' in 'where clause'
> > > >
> > > > --
> > > > This message is automatically generated by JIRA.
> > > > -
> > > > You can reply to this email to add a comment to the 
> issue online.
> > > >
> > > >
> > >
> >
> 

Re: [jira] Updated: (OPENJPA-81) Bad error message when trying to query a Collection relation using dot notation

Posted by Kevin Sutter <kw...@gmail.com>.
Patrick,
Sounds good.  I like the aggressive schedule idea.  I hope we can pull it
off...  :-)

Kevin

On 3/1/07, Patrick Linskey <pl...@bea.com> wrote:
>
> My understanding is that "Fix Version(s)" captures both the version that
> something is scheduled to be fixed in (for unresolved issues) and the
> version that something actually was fixed in (for resolved issues).
>
> "Affected Version(s)" identifies the versions that the issue is present
> in.
>
> So, I spent some time yesterday afternoon doing JIRA triage. My goals
> were to put together something of a reasonable-if-aggressive schedule
> for 0.9.7 (presumably the next release), and to adjust priorities
> according to the JIRA definitions.
>
> As ever, those changes aren't set in stone; they're just what I thought
> looked reasonable.
>
> -Patrick
>
> --
> Patrick Linskey
> BEA Systems, Inc.
>
> _______________________________________________________________________
> Notice:  This email message, together with any attachments, may contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
> entities,  that may be confidential,  proprietary,  copyrighted  and/or
> legally privileged, and is intended solely for the use of the individual
> or entity named in this message. If you are not the intended recipient,
> and have received this message in error, please immediately return this
> by email and then delete it.
>
> > -----Original Message-----
> > From: Kevin Sutter [mailto:kwsutter@gmail.com]
> > Sent: Thursday, March 01, 2007 4:55 AM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: Re: [jira] Updated: (OPENJPA-81) Bad error message
> > when trying to query a Collection relation using dot notation
> >
> > Patrick,
> > I'm a little confused with all of these updates you are doing
> > with the JIRA
> > Issues.  Most of the updates are related to specifying a Fix
> > Version of
> > 0.9.7.  Does this mean you are planning on having all of these Issues
> > resolved for 0.9.7?  Or, do you think this field specifies
> > which version
> > needs to be fixed?  There is also an Affected Version field,
> > which in my
> > mind, would more closely relate to that idea.
> >
> > Maybe I'm just not familiar enough with the JIRA usage, but
> > if you could
> > explain the reasoning behind these changes, that would be
> > great.  Thanks.
> >
> > Kevin
> >
> > On 2/28/07, Patrick Linskey (JIRA) <ji...@apache.org> wrote:
> > >
> > >
> > >      [
> > >
> > https://issues.apache.org/jira/browse/OPENJPA-81?page=com.atla
> ssian.jira.plugin.system.issuetabpanels:all-tabpanel]
> > >
> > > Patrick Linskey updated OPENJPA-81:
> > > -----------------------------------
> > >
> > >     Fix Version/s: 0.9.7
> > >
> > > > Bad error message when trying to query a Collection
> > relation using dot
> > > notation
> > > >
> > >
> > --------------------------------------------------------------
> > -----------------
> > > >
> > > >                 Key: OPENJPA-81
> > > >                 URL:
> > https://issues.apache.org/jira/browse/OPENJPA-81
> > > >             Project: OpenJPA
> > > >          Issue Type: Improvement
> > > >          Components: diagnostics, query
> > > >         Environment: openJPA 0.9.7
> > > > MySQL 5.0.15
> > > >            Reporter: Jakob Braeuchi
> > > >            Priority: Minor
> > > >             Fix For: 0.9.7
> > > >
> > > >
> > > > the query over the 1:n relationship 'katergorien'
> > > > em.createQuery("select distinct k from KategorieGruppe k " +
> > > >                       "where k.kategorien.bezeichnung like ?1 " +
> > > >                       "order by k.bezeichnung asc");
> > > > uses a wrong alias t2 in the generated SQL:
> > > > SELECT DISTINCT t0.id, t0.bezeichnung FROM
> > ekv2kategoriegruppe t0 INNER
> > > JOIN ekv2kategorie t1 ON t0.id = t1.idGruppe WHERE
> > (t2.bezeichnung LIKE ?
> > > ESCAPE '\\') ORDER BY t0.bezeichnung ASC [params=(String) F%]
> > > > Unknown column 't2.bezeichnung' in 'where clause'
> > >
> > > --
> > > This message is automatically generated by JIRA.
> > > -
> > > You can reply to this email to add a comment to the issue online.
> > >
> > >
> >
>

RE: [jira] Updated: (OPENJPA-81) Bad error message when trying to query a Collection relation using dot notation

Posted by Patrick Linskey <pl...@bea.com>.
My understanding is that "Fix Version(s)" captures both the version that
something is scheduled to be fixed in (for unresolved issues) and the
version that something actually was fixed in (for resolved issues).

"Affected Version(s)" identifies the versions that the issue is present
in.

So, I spent some time yesterday afternoon doing JIRA triage. My goals
were to put together something of a reasonable-if-aggressive schedule
for 0.9.7 (presumably the next release), and to adjust priorities
according to the JIRA definitions.

As ever, those changes aren't set in stone; they're just what I thought
looked reasonable.

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc. 

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: Kevin Sutter [mailto:kwsutter@gmail.com] 
> Sent: Thursday, March 01, 2007 4:55 AM
> To: open-jpa-dev@incubator.apache.org
> Subject: Re: [jira] Updated: (OPENJPA-81) Bad error message 
> when trying to query a Collection relation using dot notation
> 
> Patrick,
> I'm a little confused with all of these updates you are doing 
> with the JIRA
> Issues.  Most of the updates are related to specifying a Fix 
> Version of
> 0.9.7.  Does this mean you are planning on having all of these Issues
> resolved for 0.9.7?  Or, do you think this field specifies 
> which version
> needs to be fixed?  There is also an Affected Version field, 
> which in my
> mind, would more closely relate to that idea.
> 
> Maybe I'm just not familiar enough with the JIRA usage, but 
> if you could
> explain the reasoning behind these changes, that would be 
> great.  Thanks.
> 
> Kevin
> 
> On 2/28/07, Patrick Linskey (JIRA) <ji...@apache.org> wrote:
> >
> >
> >      [
> > 
> https://issues.apache.org/jira/browse/OPENJPA-81?page=com.atla
ssian.jira.plugin.system.issuetabpanels:all-tabpanel]
> >
> > Patrick Linskey updated OPENJPA-81:
> > -----------------------------------
> >
> >     Fix Version/s: 0.9.7
> >
> > > Bad error message when trying to query a Collection 
> relation using dot
> > notation
> > >
> > 
> --------------------------------------------------------------
> -----------------
> > >
> > >                 Key: OPENJPA-81
> > >                 URL: 
> https://issues.apache.org/jira/browse/OPENJPA-81
> > >             Project: OpenJPA
> > >          Issue Type: Improvement
> > >          Components: diagnostics, query
> > >         Environment: openJPA 0.9.7
> > > MySQL 5.0.15
> > >            Reporter: Jakob Braeuchi
> > >            Priority: Minor
> > >             Fix For: 0.9.7
> > >
> > >
> > > the query over the 1:n relationship 'katergorien'
> > > em.createQuery("select distinct k from KategorieGruppe k " +
> > >                       "where k.kategorien.bezeichnung like ?1 " +
> > >                       "order by k.bezeichnung asc");
> > > uses a wrong alias t2 in the generated SQL:
> > > SELECT DISTINCT t0.id, t0.bezeichnung FROM 
> ekv2kategoriegruppe t0 INNER
> > JOIN ekv2kategorie t1 ON t0.id = t1.idGruppe WHERE 
> (t2.bezeichnung LIKE ?
> > ESCAPE '\\') ORDER BY t0.bezeichnung ASC [params=(String) F%]
> > > Unknown column 't2.bezeichnung' in 'where clause'
> >
> > --
> > This message is automatically generated by JIRA.
> > -
> > You can reply to this email to add a comment to the issue online.
> >
> >
> 

Re: [jira] Updated: (OPENJPA-81) Bad error message when trying to query a Collection relation using dot notation

Posted by Kevin Sutter <kw...@gmail.com>.
Patrick,
I'm a little confused with all of these updates you are doing with the JIRA
Issues.  Most of the updates are related to specifying a Fix Version of
0.9.7.  Does this mean you are planning on having all of these Issues
resolved for 0.9.7?  Or, do you think this field specifies which version
needs to be fixed?  There is also an Affected Version field, which in my
mind, would more closely relate to that idea.

Maybe I'm just not familiar enough with the JIRA usage, but if you could
explain the reasoning behind these changes, that would be great.  Thanks.

Kevin

On 2/28/07, Patrick Linskey (JIRA) <ji...@apache.org> wrote:
>
>
>      [
> https://issues.apache.org/jira/browse/OPENJPA-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
>
> Patrick Linskey updated OPENJPA-81:
> -----------------------------------
>
>     Fix Version/s: 0.9.7
>
> > Bad error message when trying to query a Collection relation using dot
> notation
> >
> -------------------------------------------------------------------------------
> >
> >                 Key: OPENJPA-81
> >                 URL: https://issues.apache.org/jira/browse/OPENJPA-81
> >             Project: OpenJPA
> >          Issue Type: Improvement
> >          Components: diagnostics, query
> >         Environment: openJPA 0.9.7
> > MySQL 5.0.15
> >            Reporter: Jakob Braeuchi
> >            Priority: Minor
> >             Fix For: 0.9.7
> >
> >
> > the query over the 1:n relationship 'katergorien'
> > em.createQuery("select distinct k from KategorieGruppe k " +
> >                       "where k.kategorien.bezeichnung like ?1 " +
> >                       "order by k.bezeichnung asc");
> > uses a wrong alias t2 in the generated SQL:
> > SELECT DISTINCT t0.id, t0.bezeichnung FROM ekv2kategoriegruppe t0 INNER
> JOIN ekv2kategorie t1 ON t0.id = t1.idGruppe WHERE (t2.bezeichnung LIKE ?
> ESCAPE '\\') ORDER BY t0.bezeichnung ASC [params=(String) F%]
> > Unknown column 't2.bezeichnung' in 'where clause'
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>

[jira] Commented: (OPENJPA-81) Bad error message when trying to query a Collection relation using dot notation

Posted by "Jakob Braeuchi (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/OPENJPA-81?page=comments#action_12449747 ] 
            
Jakob Braeuchi commented on OPENJPA-81:
---------------------------------------

i had to put the alias behind the braces to make it work with hibernate:

select distinct k from KategorieGruppe k, in(k.kategorien) kat where kat.bezeichnung like ?1 


> Bad error message when trying to query a Collection relation using dot notation
> -------------------------------------------------------------------------------
>
>                 Key: OPENJPA-81
>                 URL: http://issues.apache.org/jira/browse/OPENJPA-81
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: diagnostics, query
>         Environment: openJPA 0.9.7
> MySQL 5.0.15
>            Reporter: Jakob Braeuchi
>            Priority: Minor
>
> the query over the 1:n relationship 'katergorien' 
> em.createQuery("select distinct k from KategorieGruppe k " +
>             		"where k.kategorien.bezeichnung like ?1 " +
>             		"order by k.bezeichnung asc");
> uses a wrong alias t2 in the generated SQL:
> SELECT DISTINCT t0.id, t0.bezeichnung FROM ekv2kategoriegruppe t0 INNER JOIN ekv2kategorie t1 ON t0.id = t1.idGruppe WHERE (t2.bezeichnung LIKE ? ESCAPE '\\') ORDER BY t0.bezeichnung ASC [params=(String) F%]
> Unknown column 't2.bezeichnung' in 'where clause' 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (OPENJPA-81) Bad error message when trying to query a Collection relation using dot notation

Posted by "Jakob Braeuchi (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/OPENJPA-81?page=comments#action_12449585 ] 
            
Jakob Braeuchi commented on OPENJPA-81:
---------------------------------------

is this a limitation of openJPA ?
the same query runs with hibernate-entitymanager and toplink-essentials.

> Bad error message when trying to query a Collection relation using dot notation
> -------------------------------------------------------------------------------
>
>                 Key: OPENJPA-81
>                 URL: http://issues.apache.org/jira/browse/OPENJPA-81
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: diagnostics, query
>         Environment: openJPA 0.9.7
> MySQL 5.0.15
>            Reporter: Jakob Braeuchi
>            Priority: Minor
>
> the query over the 1:n relationship 'katergorien' 
> em.createQuery("select distinct k from KategorieGruppe k " +
>             		"where k.kategorien.bezeichnung like ?1 " +
>             		"order by k.bezeichnung asc");
> uses a wrong alias t2 in the generated SQL:
> SELECT DISTINCT t0.id, t0.bezeichnung FROM ekv2kategoriegruppe t0 INNER JOIN ekv2kategorie t1 ON t0.id = t1.idGruppe WHERE (t2.bezeichnung LIKE ? ESCAPE '\\') ORDER BY t0.bezeichnung ASC [params=(String) F%]
> Unknown column 't2.bezeichnung' in 'where clause' 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (OPENJPA-81) Bad error message when trying to query a Collection relation using dot notation

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Linskey updated OPENJPA-81:
-----------------------------------

    Fix Version/s: 0.9.7

> Bad error message when trying to query a Collection relation using dot notation
> -------------------------------------------------------------------------------
>
>                 Key: OPENJPA-81
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-81
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: diagnostics, query
>         Environment: openJPA 0.9.7
> MySQL 5.0.15
>            Reporter: Jakob Braeuchi
>            Priority: Minor
>             Fix For: 0.9.7
>
>
> the query over the 1:n relationship 'katergorien' 
> em.createQuery("select distinct k from KategorieGruppe k " +
>             		"where k.kategorien.bezeichnung like ?1 " +
>             		"order by k.bezeichnung asc");
> uses a wrong alias t2 in the generated SQL:
> SELECT DISTINCT t0.id, t0.bezeichnung FROM ekv2kategoriegruppe t0 INNER JOIN ekv2kategorie t1 ON t0.id = t1.idGruppe WHERE (t2.bezeichnung LIKE ? ESCAPE '\\') ORDER BY t0.bezeichnung ASC [params=(String) F%]
> Unknown column 't2.bezeichnung' in 'where clause' 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-81) Bad error message when trying to query a Collection relation using dot notation

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/OPENJPA-81?page=comments#action_12449748 ] 
            
Craig Russell commented on OPENJPA-81:
--------------------------------------

Yes, it's illegal and pending a change to the specification (which is unlikely), you should rewrite the query.

Craig

> Bad error message when trying to query a Collection relation using dot notation
> -------------------------------------------------------------------------------
>
>                 Key: OPENJPA-81
>                 URL: http://issues.apache.org/jira/browse/OPENJPA-81
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: diagnostics, query
>         Environment: openJPA 0.9.7
> MySQL 5.0.15
>            Reporter: Jakob Braeuchi
>            Priority: Minor
>
> the query over the 1:n relationship 'katergorien' 
> em.createQuery("select distinct k from KategorieGruppe k " +
>             		"where k.kategorien.bezeichnung like ?1 " +
>             		"order by k.bezeichnung asc");
> uses a wrong alias t2 in the generated SQL:
> SELECT DISTINCT t0.id, t0.bezeichnung FROM ekv2kategoriegruppe t0 INNER JOIN ekv2kategorie t1 ON t0.id = t1.idGruppe WHERE (t2.bezeichnung LIKE ? ESCAPE '\\') ORDER BY t0.bezeichnung ASC [params=(String) F%]
> Unknown column 't2.bezeichnung' in 'where clause' 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (OPENJPA-81) Wrong alias used when querying an attribute of a 1:n child

Posted by "Marc Prud'hommeaux (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/OPENJPA-81?page=comments#action_12449535 ] 
            
Marc Prud'hommeaux commented on OPENJPA-81:
-------------------------------------------

You cannot traverse a Collection relation using dots. A simple example of valid JPQL is:

   SELECT OBJECT(c) FROM Customer c, IN(c.orders) o WHERE c.status = 1

In your case, you probably want:

  select distinct k from KategorieGruppe k, in(k.kategorien rel) where rel.bezeichnung like ?1

However, we really should have a better error than just generating invalid SQL, so I'll leave this issue open (although I'll change the priority and category).

> Wrong alias used when querying an attribute of a 1:n child
> ----------------------------------------------------------
>
>                 Key: OPENJPA-81
>                 URL: http://issues.apache.org/jira/browse/OPENJPA-81
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: query
>         Environment: openJPA 0.9.7
> MySQL 5.0.15
>            Reporter: Jakob Braeuchi
>
> the query over the 1:n relationship 'katergorien' 
> em.createQuery("select distinct k from KategorieGruppe k " +
>             		"where k.kategorien.bezeichnung like ?1 " +
>             		"order by k.bezeichnung asc");
> uses a wrong alias t2 in the generated SQL:
> SELECT DISTINCT t0.id, t0.bezeichnung FROM ekv2kategoriegruppe t0 INNER JOIN ekv2kategorie t1 ON t0.id = t1.idGruppe WHERE (t2.bezeichnung LIKE ? ESCAPE '\\') ORDER BY t0.bezeichnung ASC [params=(String) F%]
> Unknown column 't2.bezeichnung' in 'where clause' 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (OPENJPA-81) Bad error message when trying to query a Collection relation using dot notation

Posted by "Marc Prud'hommeaux (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/OPENJPA-81?page=all ]

Marc Prud'hommeaux updated OPENJPA-81:
--------------------------------------

    Component/s: diagnostics
        Summary: Bad error message when trying to query a Collection relation using dot notation  (was: Wrong alias used when querying an attribute of a 1:n child)
     Issue Type: Improvement  (was: Bug)
       Priority: Minor  (was: Major)

> Bad error message when trying to query a Collection relation using dot notation
> -------------------------------------------------------------------------------
>
>                 Key: OPENJPA-81
>                 URL: http://issues.apache.org/jira/browse/OPENJPA-81
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: diagnostics, query
>         Environment: openJPA 0.9.7
> MySQL 5.0.15
>            Reporter: Jakob Braeuchi
>            Priority: Minor
>
> the query over the 1:n relationship 'katergorien' 
> em.createQuery("select distinct k from KategorieGruppe k " +
>             		"where k.kategorien.bezeichnung like ?1 " +
>             		"order by k.bezeichnung asc");
> uses a wrong alias t2 in the generated SQL:
> SELECT DISTINCT t0.id, t0.bezeichnung FROM ekv2kategoriegruppe t0 INNER JOIN ekv2kategorie t1 ON t0.id = t1.idGruppe WHERE (t2.bezeichnung LIKE ? ESCAPE '\\') ORDER BY t0.bezeichnung ASC [params=(String) F%]
> Unknown column 't2.bezeichnung' in 'where clause' 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (OPENJPA-81) Bad error message when trying to query a Collection relation using dot notation

Posted by "Jakob Braeuchi (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/OPENJPA-81?page=comments#action_12449737 ] 
            
Jakob Braeuchi commented on OPENJPA-81:
---------------------------------------

hi marc,

yes KategorieGruppe.kategorien is a collection and it's supported by both toplink and hibernate.
if it's illegal, i'll have to rewrite the query.

thanks
jakob


> Bad error message when trying to query a Collection relation using dot notation
> -------------------------------------------------------------------------------
>
>                 Key: OPENJPA-81
>                 URL: http://issues.apache.org/jira/browse/OPENJPA-81
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: diagnostics, query
>         Environment: openJPA 0.9.7
> MySQL 5.0.15
>            Reporter: Jakob Braeuchi
>            Priority: Minor
>
> the query over the 1:n relationship 'katergorien' 
> em.createQuery("select distinct k from KategorieGruppe k " +
>             		"where k.kategorien.bezeichnung like ?1 " +
>             		"order by k.bezeichnung asc");
> uses a wrong alias t2 in the generated SQL:
> SELECT DISTINCT t0.id, t0.bezeichnung FROM ekv2kategoriegruppe t0 INNER JOIN ekv2kategorie t1 ON t0.id = t1.idGruppe WHERE (t2.bezeichnung LIKE ? ESCAPE '\\') ORDER BY t0.bezeichnung ASC [params=(String) F%]
> Unknown column 't2.bezeichnung' in 'where clause' 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (OPENJPA-81) Bad error message when trying to query a Collection relation using dot notation

Posted by "Marc Prud'hommeaux (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/OPENJPA-81?page=comments#action_12449592 ] 
            
Marc Prud'hommeaux commented on OPENJPA-81:
-------------------------------------------

Is KategorieGruppe.kategorien a Collection? If so, then it is a violation of the spec to query it by dot notation. I'm surprised that Hibernate and Toplink would support it, since it is explicitly illegal.

Specifically, section 4.4.4 of the specification says: "Path expressions can be composed from other path expressions if the original path expression evaluates to a single-valued type (not a collection) corresponding to a association-field."


> Bad error message when trying to query a Collection relation using dot notation
> -------------------------------------------------------------------------------
>
>                 Key: OPENJPA-81
>                 URL: http://issues.apache.org/jira/browse/OPENJPA-81
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: diagnostics, query
>         Environment: openJPA 0.9.7
> MySQL 5.0.15
>            Reporter: Jakob Braeuchi
>            Priority: Minor
>
> the query over the 1:n relationship 'katergorien' 
> em.createQuery("select distinct k from KategorieGruppe k " +
>             		"where k.kategorien.bezeichnung like ?1 " +
>             		"order by k.bezeichnung asc");
> uses a wrong alias t2 in the generated SQL:
> SELECT DISTINCT t0.id, t0.bezeichnung FROM ekv2kategoriegruppe t0 INNER JOIN ekv2kategorie t1 ON t0.id = t1.idGruppe WHERE (t2.bezeichnung LIKE ? ESCAPE '\\') ORDER BY t0.bezeichnung ASC [params=(String) F%]
> Unknown column 't2.bezeichnung' in 'where clause' 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira