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

From Eclipsepedia

Jump to: navigation, search
m
m
Line 28: Line 28:
 
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> {{EclipseLink_Spec|section=Section 8.1 "Entity"}}
+
* <tt>@Entity</tt> :{{EclipseLink_Spec|section=Section 10.1 "Entity Annotation"}}
* <tt>[[Introduction%20to%20EclipseLink%20JPA%20(ELUG)#@MappedSuperclass|@MappedSuperclass]]</tt>
+
* <tt>@MappedSuperclass</tt>{{EclipseLink_Spec|section=Section 11.1.34 "MappedSuperclass Annotation"}}
* <tt>[[Introduction%20to%20EclipseLink%20JPA%20(ELUG)#@Embeddable|@Embeddable]]</tt>
+
* <tt>@Embeddable</tt>{{EclipseLink_Spec|section=Section 11.1.3 "Embeddable Annotation"}}
  
 
You can use EclipseLink converters with the following mappings:
 
You can use EclipseLink converters with the following mappings:

Revision as of 12:26, 2 May 2011



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 10.1 "Entity Annotation" in the JPA Specification.

  • @MappedSuperclass
Elug javaspec icon.gif

For more information, see Section 11.1.34 "MappedSuperclass Annotation" in the JPA Specification.

  • @Embeddable
Elug javaspec icon.gif

For more information, see Section 11.1.3 "Embeddable Annotation" 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...

Elug previous icon.png@Column link=‎
Basic Mappings
@Converterlink=‎
link=‎ EclipseLink Home

JPA User Guide: Elug guide icon.pngTable of Contents, Search elug.pngSearch

How to contribute to this guide...