cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikita Timofeev (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (CAY-2368) ColumnSelect: Property.self() translates into wrong SQL code
Date Mon, 02 Oct 2017 14:21:00 GMT

     [ https://issues.apache.org/jira/browse/CAY-2368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Nikita Timofeev closed CAY-2368.
--------------------------------
       Resolution: Fixed
    Fix Version/s: 4.0.B3

*4.0*: https://github.com/apache/cayenne/commit/c0c0cfa05ff1386c3ba97b9f0d7ed9bdf99fd584

> ColumnSelect: Property.self() translates into wrong SQL code
> ------------------------------------------------------------
>
>                 Key: CAY-2368
>                 URL: https://issues.apache.org/jira/browse/CAY-2368
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 4.0.B2, 4.1.M1
>            Reporter: Nikita Timofeev
>            Assignee: Nikita Timofeev
>             Fix For: 4.0.B3, 4.1.M1
>
>
> In some cases column query with "self" property can be translated into wrong SQL.
> In particular following code:
> {code}
> ObjectSelect.columnQuery(Artist.class, 
>                 Artist.PAINTING_ARRAY.dot(Painting.PAINTING_TITLE),
>                 Property.createSelf(Artist.class)).select(context);
> {code}
> Translates into this SQL:
> {code}
> SELECT 
>     DISTINCT t1.PAINTING_TITLE, 
>     t1.ARTIST_NAME, t1.DATE_OF_BIRTH, t1.ARTIST_ID 
> FROM ARTIST t0 
> JOIN PAINTING t1 ON (t0.ARTIST_ID = t1.ARTIST_ID)
> {code}
> Here is wrong {{t1}} alias used for {{Artist}} property. Note that changing order of
columns leads to correct query.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message