Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Basic Mappings/Default Conversions and Converters"

m (Default Conversions and Converters)
m (Default Conversions and Converters)
Line 2: Line 2:
 
EclipseLink defines the following converter annotations (in addition to JPA-defined ones):
 
EclipseLink defines the following converter annotations (in addition to JPA-defined ones):
  
* <tt>[[#How to Use the @Converter Annotation|@Converter]]</tt>
+
* <tt>[[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Default_Conversions_and_Converters/Converter|@Converter]]</tt>
* <tt>[[#How to Use the @TypeConverter Annotation|@TypeConverter]]</tt>
+
* <tt>[[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Default_Conversions_and_Converters/TypeConverter|@TypeConverter]]</tt>
* <tt>[[#How to Use the @ObjectTypeConverter Annotation|@ObjectTypeConverter]]</tt>
+
* <tt>[[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Default_Conversions_and_Converters/ObjectTypeConverter|@ObjectTYpeConverter]]</tt>
* <tt>[[#How to Use the @StructConverter Annotation|@StructConverter]]</tt>
+
* <tt>[[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Default_Conversions_and_Converters/StructConverter|@StructConverter]]</tt>
* <tt>[[#How to Use the @Convert Annotation|@Convert]]</tt>
+
* <tt>[[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Default_Conversions_and_Converters/Convert|@Convert]]</tt>
  
 
EclipseLink persistence provider searches the converter annotations in the following order:
 
EclipseLink persistence provider searches the converter annotations in the following order:
Line 18: Line 18:
 
You can define converters at the class, field and property level. You can specify EclipseLink converters on the following classes:
 
You can define converters at the class, field and property level. You can specify EclipseLink converters on the following classes:
  
* <tt>@Entity</tt> (see Section 8.1 "Entity" of the [http://jcp.org/en/jsr/detail?id=220 JPA Specification])
+
* <tt>@Entity</tt> {{EclipseLink_Spec|section=Section 8.1 "Entity"}}
 
* <tt>[[Introduction%20to%20EclipseLink%20JPA%20(ELUG)#@MappedSuperclass|@MappedSuperclass]]</tt>
 
* <tt>[[Introduction%20to%20EclipseLink%20JPA%20(ELUG)#@MappedSuperclass|@MappedSuperclass]]</tt>
 
* <tt>[[Introduction%20to%20EclipseLink%20JPA%20(ELUG)#@Embeddable|@Embeddable]]</tt>
 
* <tt>[[Introduction%20to%20EclipseLink%20JPA%20(ELUG)#@Embeddable|@Embeddable]]</tt>
Line 25: Line 25:
  
 
* <tt>[[Introduction%20to%20EclipseLink%20JPA%20(ELUG)#@Basic|@Basic]]</tt>
 
* <tt>[[Introduction%20to%20EclipseLink%20JPA%20(ELUG)#@Basic|@Basic]]</tt>
* <tt>[[Introduction%20to%20EclipseLink%20JPA%20(ELUG)#@Id|@Id]]</tt>
+
* <tt>[[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Entity/Id|@Id]]</tt>
 
* <tt>[[Introduction%20to%20EclipseLink%20JPA%20(ELUG)#Configuring Locking|@Version]]</tt>
 
* <tt>[[Introduction%20to%20EclipseLink%20JPA%20(ELUG)#Configuring Locking|@Version]]</tt>
 
* <tt>[[#How to Use the @BasicMap Annotation|@BasicMap]]</tt>
 
* <tt>[[#How to Use the @BasicMap Annotation|@BasicMap]]</tt>
Line 34: Line 34:
  
 
{{EclipseLink_JPA
 
{{EclipseLink_JPA
|previous=[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Column|Column]]
+
|previous=[[EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Basic Mappings/Column|Column]]
 
|next=[[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Default_Conversions_and_Converters/Converter|@Converter]]
 
|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:25, 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:

You can define converters at the class, field and property level. You can specify EclipseLink converters on the following classes:

  • @Entity
Elug javaspec icon.gif

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.


Eclipselink-logo.gif
Version: DRAFT
Other versions...

Back to the top