You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Nikita Timofeev (JIRA)" <ji...@apache.org> on 2017/08/31 08:08:00 UTC

[jira] [Updated] (CAY-2357) Generic select queries silently convert result to nulls if no PK column found

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

Nikita Timofeev updated CAY-2357:
---------------------------------
    Description: 
{{SQLTemplate}} by default tries to convert result into object ({{selectDataRows}} set to {{false}}),
however if there are no PK columns for required entity in result this lead to {{null}} without any hit to the user. That definitely leads to confusion, see this SO question for example https://stackoverflow.com/questions/45907666/select-custom-data-with-cayenne-return-empty-lines 
Problem is that {{EJBQL}} uses very same logic for result conversion, so this should be fixed keeping in mind that {{null}} is a valid result in case of some OUTER JOIN, or missing to-one relationship. 

  was:
{{SQLTemplate}} by default tries to convert result into object if {{selectDataRows}} set to {{false}},
however if there are no PK columns for required entity in result this lead to {{null}} without any hit to the user. That definitely leads to confusion, see this SO question for example https://stackoverflow.com/questions/45907666/select-custom-data-with-cayenne-return-empty-lines 
Problem is that {{EJBQL}} uses very same logic for result conversion, so this should be fixed keeping in mind that {{null}} is a valid result in case of some OUTER JOIN, or missing to-one relationship. 


> Generic select queries silently convert result to nulls if no PK column found
> -----------------------------------------------------------------------------
>
>                 Key: CAY-2357
>                 URL: https://issues.apache.org/jira/browse/CAY-2357
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 4.0.B1, 4.1.M1
>            Reporter: Nikita Timofeev
>            Assignee: Nikita Timofeev
>            Priority: Minor
>
> {{SQLTemplate}} by default tries to convert result into object ({{selectDataRows}} set to {{false}}),
> however if there are no PK columns for required entity in result this lead to {{null}} without any hit to the user. That definitely leads to confusion, see this SO question for example https://stackoverflow.com/questions/45907666/select-custom-data-with-cayenne-return-empty-lines 
> Problem is that {{EJBQL}} uses very same logic for result conversion, so this should be fixed keeping in mind that {{null}} is a valid result in case of some OUTER JOIN, or missing to-one relationship. 



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