[ https://issues.apache.org/jira/browse/JDO-650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14311452#comment-14311452 ]
Michael Bouschen commented on JDO-650: -------------------------------------- Added a new test case to IfElseInFilter using mutiple IF ELSE clauses. It looks like the generated SQL changes the order of the CASE statements, which lead to an unexpected query result. JDOQL: SELECT FROM org.apache.jdo.tck.pc.company.FullTimeEmployee WHERE (IF (this.salary < 10001.0) 1 ELSE IF (this.salary < 20001.0) 2 ELSE IF (this.salary < 30001.0) 3 ELSE 4) == 2 ORDER BY this.personid Generated SQL: SELECT ... FROM APPLICATIONIDENTITY0.PERSONS A0 WHERE A0.DISCRIMINATOR = 'org.apache.jdo.tck.pc.company.FullTimeEmployee' AND (CASE WHEN A0.SALARY < 30001 THEN 3 WHEN A0.SALARY < 10001 THEN 1 WHEN A0.SALARY < 20001 THEN 2 ELSE 4 END) = 2 ORDER BY NUCORDER0 > Support for conditional operator ? : in JDOQL > --------------------------------------------- > > Key: JDO-650 > URL: https://issues.apache.org/jira/browse/JDO-650 > Project: JDO > Issue Type: New Feature > Components: specification, tck > Affects Versions: JDO 2 maintenance release 2 (2.2) > Reporter: Michael Bouschen > Assignee: Michael Bouschen > Fix For: JDO 3.1 > > > JDOQL should support the Java conditional operator ? :, e.g. salary >= 1000.0 > ? salary : salary * 1.1 > The conditional operator can be mapped to the CASE-expression in SQL: CASE > WHEN condition THEN thenExpr ELSE elseExpr END. Are there any issues with > non-SQL datastores when supporting the conditional operator? > Another question: which part of a JDOQL query can include a conditional > expression? I propose the query filter, the having clause and the result > specification. -- This message was sent by Atlassian JIRA (v6.3.4#6332)