You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by "Craig L Russell (JIRA)" <ji...@apache.org> on 2016/07/08 16:00:12 UTC

[jira] [Comment Edited] (JDO-751) Support for Java8 Optional

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

Craig L Russell edited comment on JDO-751 at 7/8/16 3:59 PM:
-------------------------------------------------------------

Starting to work on the specification:

Persistent Object Model 6.4.3

java.lang.Optional

JDO implementations must support fields of type Optional<T> where T is any supported Object type. They may be mapped to nullable datastore types or to Optional<T> types at the option of the JDO implementation.

When instantiating an instance from the datastore, the JDO implementation would get the value v from the datastore and assign the field f = Optional<T>.ofNullable(v). When storing the field in the datastore, the persistence implementation would store the result of v = f.isPresent()?f.get():null.




was (Author: clr):
Starting to work on the specification:

Persistent Object Model 6.4.3

java.lang.Optional

JDO implementations must support fields of type Optional<T> where T is any supported Object type. They may be mapped to nullable datastore types or to Optional<T> types at the option of the JDO implementation.



> 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-v5.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)