Jump to: navigation, search

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

m
m
Line 3: Line 3:
 
EclipseLink defines the following converter annotations and XML attributes (in addition to JPA-defined ones):
 
EclipseLink defines the following converter annotations and XML attributes (in addition to JPA-defined ones):
  
* <tt>[[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Default_Conversions_and_Converters/Converter|@Converter and <converter>]]</tt>
+
* <tt>[[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Default_Conversions_and_Converters/Converter|@Converter]]</tt>
* <tt>[[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Default_Conversions_and_Converters/TypeConverter|@TypeConverter and <type-converter>]]</tt>
+
* <tt>[[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Default_Conversions_and_Converters/TypeConverter|@TypeConverter]]</tt>
* <tt>[[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Default_Conversions_and_Converters/ObjectTypeConverter|@ObjectTypeConverter and <object-type-converter>]]</tt>
+
* <tt>[[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Default_Conversions_and_Converters/ObjectTypeConverter|@ObjectTypeConverter]]</tt>
* <tt>[[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Default_Conversions_and_Converters/StructConverter|@StructConverter and <struct-converter>]]</tt>
+
* <tt>[[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Default_Conversions_and_Converters/StructConverter|@StructConverter]]</tt>
* <tt>[[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Default_Conversions_and_Converters/Convert|@Convert and <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:
  
* <tt>[[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Default_Conversions_and_Converters/Convert|@Convert]]</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>
* <tt>[[Introduction%20to%20EclipseLink%20JPA%20(ELUG)#@Temporal|@Temporal]]</tt>
+
# <tt>[[Introduction%20to%20EclipseLink%20JPA%20(ELUG)#@Temporal|@Temporal]]</tt>
* Serialized (automatic)
+
# Serialized (automatic)
  
 
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:

Revision as of 09:07, 5 April 2011


link="http://wiki.eclipse.org/EclipseLink"
EclipseLink
Website
Download
Community
Mailing ListForumsIRC
Bugzilla
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):

EclipseLink persistence provider searches the converter annotations in the following order:

  1. @Convert
  2. @Enumerated
  3. @Lob
  4. @Temporal
  5. Serialized (automatic)

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: 2.1.0
Other versions...