[ 
https://issues.apache.org/jira/browse/JDO-751?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15339802#comment-15339802
 ] 

Andy Jefferson commented on JDO-751:
------------------------------------

1. You use "this.optionalPC.orElse(otherPcParam) == null", so if optionalPC is 
NULL then you compare otherPcParam with "null" and since that "otherPcParam" is 
transient, then it equates to NULL in DN handling. You cannot use transient PC 
params in DN.

2. You use "this.optionalDate.orElse(otherDateParam) == myDateParam" and so if 
optionalDate is set to myDateParam then you are comparing 2 dates that are 
nominally the same. Some RDBMS handle that in my experience (e.g H2) and some 
don't. 

3. This navigational construct is not supported by DN because DN expects 
complete Java syntax (with a null check). Yes, there is some minor phrase in 
the spec that implies an implementation can support not specifying all of the 
"optionalPC != null && optionalPC.optionalPC ..." but DN doesn't and never has. 
If you put all such navigational refs with the "optionalPC != null &&" 
prepended then you will have more chance of success. No other JDO TCK test 
requires that handling. 

And I would sincerely hope that Optional does not become so common that people 
are chaining navigational calls to it :-S

> Support for Java8 Optional
> --------------------------
>
>                 Key: JDO-751
>                 URL: https://issues.apache.org/jira/browse/JDO-751
>             Project: JDO
>          Issue Type: New Feature
>          Components: specification, tck
>            Reporter: Andy Jefferson
>             Fix For: JDO 3.2
>
>         Attachments: JDO-751-tck-patch-v4.txt
>
>
> java.util.Optional provides a feature that is available in other languages. 
> Since JDO 3.2 will be for Java8+ then it makes sense to add support for this 
> as a "supported persistable type"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to