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

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

Some of the confusion is the use of the term "default" for annotation defaults 
and behavior defaults. 

Maybe an example will help me understand better, using the annotation default 
value for converter(UseDefault.class) and useDefaultConversion(false):

Case 1:
@Persistent(column("ss_name")), 
or what is seen by the implementation with default values for annotation:
@Persistent(column("ss_name"), converter(UseDefault.class), 
useDefaultConversion(false))
Standard behavior: in order, use the class converter for the type, or the PMF 
converter, or the default conversion

Case 2:
@Persistent(column("ss_name"), useDefaultConversion(true)), 
or what is seen by the implementation with default values for annotation:
@Persistent(column("ss_name"), converter(UseDefault.class), 
useDefaultConversion(true))
use the default conversion regardless of whether a converter is specified at 
the class or PMF

Case 3:
@Persistent(column("ss_name"), converter(SpecialConverter.class)), 
or what is seen by the implementation with default values for annotation:
@Persistent(column("ss_name"), converter(SpecialConverter.class), 
useDefaultConversion(false))
use the special converter specified

Case 4:
@Persistent(column("ss_name"), converter(SpecialConverter.class), 
useDefaultConversion(true)), 
or what is seen by the implementation with default values for annotation:
@Persistent(column("ss_name"), converter(SpecialConverter.class), 
useDefaultConversion(true))
error at the time this class is loaded

@Andy:  "If we [default the useDefaultConversion to] "false" then that implies 
it will need a provided converter." 
I think the only confusion is in case 1 where it may sound like both "use 
default converter class" and "don't use default conversion". Which is the 
confusion between annotation default and default behavior. 


> 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