Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Basic Mappings/Default Conversions and Converters"
< EclipseLink | UserGuide | JPA | Basic JPA Development | Mapping | Basic Mappings
m |
m |
||
Line 11: | Line 11: | ||
EclipseLink persistence provider searches the converter annotations in the following order: | EclipseLink persistence provider searches the converter annotations in the following order: | ||
− | * <tt>[[ | + | * <tt>[[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Default_Conversions_and_Converters/Convert|@Convert]]</tt> |
* <tt>[[Introduction%20to%20EclipseLink%20JPA%20(ELUG)#@Enumerated|@Enumerated]]</tt> | * <tt>[[Introduction%20to%20EclipseLink%20JPA%20(ELUG)#@Enumerated|@Enumerated]]</tt> | ||
* <tt>[[Introduction%20to%20EclipseLink%20JPA%20(ELUG)#@Lob|@Lob]]</tt> | * <tt>[[Introduction%20to%20EclipseLink%20JPA%20(ELUG)#@Lob|@Lob]]</tt> |
Revision as of 09:28, 21 June 2010
EclipseLink | |
Website | |
Download | |
Community | |
Mailing List • Forums • IRC • mattermost | |
Issues | |
Open • Help Wanted • Bug Day | |
Contribute | |
Browse Source |
Default Conversions and Converters
EclipseLink defines the following converter annotations and XML attributes (in addition to JPA-defined ones):
- @Converter and <converter>
- @TypeConverter and <type-converter>
- @ObjectTypeConverter and <object-type-converter>
- @StructConverter and <struct-converter>
- @Convert and <convert>
EclipseLink persistence provider searches the converter annotations in the following order:
- @Convert
- @Enumerated
- @Lob
- @Temporal
- Serialized (automatic)
You can define converters at the class, field and property level. You can specify EclipseLink converters on the following classes:
- @Entity
For more information, see Section 8.1 "Entity" in the JPA Specification.
You can use EclipseLink converters with the following mappings:
If you specify a converter with any other type of mapping annotation, EclipseLink will throw an exception.