@Target({METHOD,FIELD,TYPE})
@Retention(RUNTIME)
@Repeatable(Converts.class)
public @interface Convert
The Convert annotation is used to specify the conversion of a Basic field or
property. It is not necessary to use the Basic annotation or corresponding XML
element to specify the basic type.
- Since:
- Java Persistence 2.1
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe attributeName must be specified unless the Convert annotation is on an attribute of basic type or on an element collection of basic type.Specifies the converter to be applied.booleanUsed to disable an auto-apply or inherited converter.
-
Element Details
-
converter
Class converterSpecifies the converter to be applied. A value for this element must be specified if multiple converters would otherwise apply.- Returns:
- converter
- Default:
- void.class
-
attributeName
String attributeNameThe attributeName must be specified unless the Convert annotation is on an attribute of basic type or on an element collection of basic type. In these cases, attributeName must not be specified.- Returns:
- attribute name
- Default:
- ""
-
disableConversion
boolean disableConversionUsed to disable an auto-apply or inherited converter. If disableConversion is true, the converter element should not be specified.- Returns:
- disable
- Default:
- false
-