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 "Andy Jefferson (JIRA)" <ji...@apache.org> on 2015/05/19 12:54:00 UTC

[jira] [Comment Edited] (JDO-709) Standardize field/property converters

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

Andy Jefferson edited comment on JDO-709 at 5/19/15 10:53 AM:
--------------------------------------------------------------

As said above, you cannot do "default null" (my comment "crapness of Java annotation defaulting"). Maybe get those Java language spec people at Oracle to allow it?

Regarding "disableConversion" and "converter", yes it is not perfect how they interact. 
We have the following ways of handling a member (or key/value/element) : 
* default JDO implementation (internal) handling (what people get with JDO 3.1 or earlier)
* PMF default converter for the type
* optional class-level default converter for the type
* optional member/element/key/value converter for the type

One way we could interpret it all
1. converter not specified, disableConversion = false -> use class-level converter if available, else use PMF converter if available, otherwise fallback to default implementation handling.
2. converter not specified, disableConversion = true -> use default implementation handling
3. converter specified, disableConversion = false -> use converter
4. converter specified, disableConversion = true -> use default implementation handling

Better ideas?


was (Author: andy):
As said above, you cannot do "default null" (my comment "crapness of Java annotation defaulting"). Maybe get those Java language spec people at Oracle to allow it?

If you specify "converter" and "disableConversion" then the disable is ignored. It means the exact same as the XML variant that was already discussed. i.e
1. No converter, no disable -> use PMF converter if one is provided
2. No converter, with disable -> use no converter
3. Converter specified -> use converter

"PMF level" means the same as your "PMF converter"

> Standardize field/property converters
> -------------------------------------
>
>                 Key: JDO-709
>                 URL: https://issues.apache.org/jira/browse/JDO-709
>             Project: JDO
>          Issue Type: New Feature
>          Components: api
>            Reporter: Matthew T. Adams
>            Assignee: Matthew T. Adams
>            Priority: Minor
>              Labels: converstion, converter, jdo, type, type-converter
>             Fix For: JDO 3.2
>
>         Attachments: JDO-709-01.patch, JDO-709-3.patch, JDO-709-4.patch
>
>
> This request is to standardize a user's ability to specify conversions of fields or properties of persistence-capable classes.  Currently, this is left to vendor extensions.



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