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] [Updated] (CAY-2208) SQLTemplate: LEFT JOIN to a subset of a table returns nulls for entries that don't have a match in the subset
Date Fri, 24 Mar 2017 13:49:42 GMT

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

Nikita Timofeev updated CAY-2208:
---------------------------------
    Fix Version/s: 4.0.M6

> SQLTemplate: LEFT JOIN to a subset of a table returns nulls for entries that don't have
a match in the subset
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: CAY-2208
>                 URL: https://issues.apache.org/jira/browse/CAY-2208
>             Project: Cayenne
>          Issue Type: Bug
>    Affects Versions: 4.0.M3
>            Reporter: Andrei Tomashpolskiy
>             Fix For: 4.0.M6
>
>
> I have a query:
> {code}
> SELECT *
> FROM table1 t1
> LEFT JOIN (SELECT * FROM table2 WHERE <some condition>) t2
> 	ON (<join by several columns>)
> {code}
> Let's say I have:
> - 6 entries in table1
> - 4 entries in table2 that satisfy the WHERE condition
> In Java I do the following:
> {code}
> SQLTemplate query = new SQLTemplate(Table1.class, <query from above>);
> <set params for WHERE condition>
> List<Table1> rows = (List<Table1>) context.performQuery(query);
> {code}
> *rows* has 6 elements and contains 4 matching entries and 2 _nulls_
> Database is MySQL 5.6.22-log Community Server (GPL)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message