Java Persistence API (JPA) Extensions Reference for EclipseLink, Release 2.4
  Go To Table Of Contents


Use @TypeConverters to define multiple TypeConverter elements.

Annotation Elements

Table 2-73 describes this annotation's elements.

Table 2-73 @TypeConverters Annotation Elements

Annotation Element Description Default


(Required) An array of type converter.


Example 2-117 shows how to use this annotation.

Example 2-117 Using @TypeConverters Annotation

public class Parameters implements Serializable {
    private static final long serialVersionUID = -1979843739878183696L;
    @Column(name="maxValue", nullable=false, length=512)
    private BigInteger maxValue;

Example 2-117 shows how to use the <type-converters> element in the eclipselink-orm.xml file.

Example 2-118 Using <type-converters> XML

    <type-converter name="Long2String" data-type="String" object-type="Long"/>
    <type-converter name="String2String" data-type="String" object-type="String"/>
<entity class="Employee">

See Also

For more information, see: