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

Craig L Russell commented on JDO-709:
-------------------------------------

Apologies for the null annotation issue. I'll fall on my sword.

My biggest concern is the naming of disableConversion. It really means "use 
Implementation Conversion" since there is always a conversion. It might help if 
we talk about "default" to mean only the JDO specified implementation default. 
Everything else is an override, which can be specified at the PMF level, the 
class level, and the field (key and value as well) level.

I guess it would be clearer for me to have "useDefaultConversion" in the 
annotation. You can override the default conversion either at the PMF, the 
class, or the field/key/value level.

1. If neither is specified on the the annotation:  -> use class-level converter 
if available, else use PMF converter if available, otherwise fallback to 
default implementation handling.
2. If only the useDefaultConversion is specified (true): -> use default 
implementation handling
3. If only the converter is specified as converter(SpecialConverter.class): -> 
use converter
4. If both the converter is specified as converter(SpecialConverter.class), 
useDefaultConversion(true): -> this is an error and throws an exception during 
annotation processing.

Along the same lines, how about changing the name of the "marker" converter:

+       public static class UseDefault implements AttributeConverter<Object, 
Object>
+       {
+               public Object convertToDatastore(Object attributeValue) {
+                       throw new JDOUserException("This converter is not 
usable.");
+               }
+
+               public Object convertToAttribute(Object datastoreValue) {
+                       throw new JDOUserException("This converter is not 
usable.");
+               }
+       }







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

Reply via email to