Loading
Java Persistence API (JPA) Extensions Reference for EclipseLink, Release 2.4
  Go To Table Of Contents
Contents
 Search
Other Searches
 PDF
PDF
Comments
Comments


@ObjectTypeConverters

Use @ObjectTypeConverters to define multiple ObjectTypeConverter items.


Annotation Elements

Table 2-44 describes this annotation's elements.

Table 2-44 @ObjectTypeConverters Annotation Elements

Annotation Element Description Default

ObjectTypeConverter

(Required) An array of @ObjectTypeConverter




Examples

Example 2-82 shows how to use this annotation.

Example 2-82 Using @ObjectTypeConverters Annotation

@Entity(name="Employee")
@Table(name="CMP3_FA_EMPLOYEE")
@ObjectTypeConverters({
  @ObjectTypeConverter(
    name="sex",
    dataType=String.class,
    objectType=org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee.Gender.class,
    conversionValues={
      @ConversionValue(dataValue="F", objectValue="Female"),
      @ConversionValue(dataValue="M", objectValue="Male")
    }
  )
})

To define multiple object type converts in the eclipselink-orm.xml file, simply create a list of multiple <object-type-converter> elements.


See Also

For more information, see:

Comments powered by Disqus