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

Renato Garcia commented on JDO-751:
-----------------------------------

{quote}
Just to clarify the first question: I see that 'Optional' should be allowed to 
reference persistence classes (as FCOs) as well as SCOs (such as String, ...). 
But I guess Optional itself should not be a persistent type?
{quote}

Optional type can be seen as a collection containing zero or one item, so 
perhaps it would make sense to address them the same way the spec addresses the 
other collection types.

Regarding JDOQL support, I kind of like the idea of supporting methods like 
isPresent and make a distinction as Tilmann has mentioned above.

Also, given the following scenario: Person FCO with an Optional<Address>
I think it would probably be nice to be able to just write something like this 
in the query:
{code:java}
person.address.postCode = foo
{code}
instead of having to deference the value using get

> 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
>
> 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