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 (→Default Conversions and Converters) |
m (→Default Conversions and Converters) |
||
Line 35: | Line 35: | ||
{{EclipseLink_JPA | {{EclipseLink_JPA | ||
|previous=[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Column|Column]] | |previous=[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Column|Column]] | ||
− | |next=[[EclipseLink/UserGuide/JPA/ | + | |next=[[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Default_Conversions_and_Converters/Converter|@Converter]] |
|up=[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Basic Mappings|Basic Mappings]]}} | |up=[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Basic Mappings|Basic Mappings]]}} |
Revision as of 09:21, 17 June 2010
Default Conversions and Converters
EclipseLink defines the following converter annotations (in addition to JPA-defined ones):
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 (see Section 8.1 "Entity" of the JPA Specification)
- @MappedSuperclass
- @Embeddable
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.