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). |
|
transformerClass |
User-defined class that implements the The class will be instantiated, its |
|
Note: You must specify either a |
Usage
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
).
Examples
See "Using @Transformation Annotation" for an example of how to use the @WriteTransformer annotation
with a Transformation mapping.
See Also
For more information, see: