Converters

Use the Converter area in the JPA Details view to specify a way to modify data value(s) during the reading and writing of a mapped attribute.

Property Description Default Available for Entity Type

Converters

Click Add and use the Add Converter dialog to create a new converter.

  • Object Type – converts a fixed number of database data value(s) to Java object value(s)

  • Type – modifies data values

  • Struct – Enable custom processing of java.sql.Struct types

  • Custom


Entity, Embeddable, and Mapped superclass

Name

The String name for your converter, must be unique across the persistence unit


Entity, Embeddable, and Mapped superclass

Class

The class of your converter. This class must implement the org.eclipse.persistence.mappings.converters.Converter interface.

Appears for Custom and Struct converters only.


Entity, Embeddable, and Mapped superclass

Data type

The type stored in the database.

Appears for Object Type and Type converters only.


Entity, Embeddable, and Mapped superclass

Object type

The type stored on the entity.

Appears for Object Type and Type converters only.


Entity, Embeddable, and Mapped superclass

Conversion values

The array of conversion values (instances of ConversionValue: String objectValue and String dataValue).

Appears for Object Type converters only.


Entity, Embeddable, and Mapped superclass

Default object value

Set the value of this attribute to the default object value. Note that this argument is for dealing with legacy data if the data value is missing.

Appears for Object Type converters only.


Entity, Embeddable, and Mapped superclass


Related reference