[
https://issues.apache.org/jira/browse/JDO-650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14115482#comment-14115482
]
Craig L Russell commented on JDO-650:
-------------------------------------
We have three choices to implement this functionality :
a) expr ? exprT : exprF
b) IF(...) ELSE...
c) SQL syntax
The a syntax is Java.
The b syntax is "very close to" Java but there are some cases where you can't
simply copy and paste JDOQL into a Java program. So this would just be one more
case.
The c syntax is not very close to Java.
I withdraw my objection to use of syntax b. As Andy says, implementing syntax a
can be done later if we choose.
> 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.2
>
>
> JDOQL should support the Java conditional operator ? :, e.g. salay >= 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.2#6252)