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


Use @ReadTransformer with Transformation mappings to define the transformation of the database column values into attribute values (unless the mapping is write-only).

Annotation Elements

Table 2-59 describes this annotation's elements.

Table 2-59 @ReadTransformer Annotation Elements

Annotation Element Description Default


The mapped class must have a method with this name which returns a value to be assigned to the attribute (not assigns the value to the attribute).


User-defined class that implements the org.eclipse.persistence.mappings.transformers.AttributeTransformer interface.

The class will be instantiated, its buildAttributeValue will be used to create the value to be assigned to the attribute.



You must specify either a method or transformerClass, but not both.


Also unless it's a read-only mapping, either @WriteTransformer annotation or @WriteTransformers annotation should be specified. Each WriteTransformer defines transformation of the attribute value to a single database column value (column is specified in the WriteTransformer).


See "Using @Transformation Annotation" for an example of how to use the @WriteTransformer annotation with a Transformation mapping.

See Also

For more information, see: