Annotation for TransformationMapping.
Unless the TransformationMapping is write-only, it should have a
ReadTransformer defining transformation of database column(s) value(s) into attribute value.
Also, unless it's a read-only mapping, either WriteTransformer 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).
Transformation can be specified within an Entity, MappedSuperclass and Embeddable class.
- See Also:
- Author:
- Andrei Ilitchev
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe 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).Class<?> User-defined class that must implement the AttributeTransformer interface.
-
Element Details
-
transformerClass
Class<?> transformerClassUser-defined class that must implement the AttributeTransformer interface. The class will be instantiated, its buildAttributeValue will be used to create the value to be assigned to the attribute.Either transformerClass or method() must be specified, but not both.
- Default:
void.class
-
method
String methodThe 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).Either transformerClass() or method must be specified, but not both.
- Default:
""
-