Top Description Methods
jakarta.persistence

public @Interface Converter

extends Annotation
Annotations
@Target:TYPE
@Retention:RUNTIME
Imports
java.lang.annotation.Target, .Retention

Declares that the annotated class is a converter and specifies whether the converter is automatically applied.

Every converter class must implement AttributeConverter and must be annotated with the Converter annotation or declared as a converter in the object/relational mapping descriptor. The target type for a converter is determined by the actual type argument of the first type parameter of AttributeConverter.

If autoApply = true, the persistence provider must automatically apply the converter to every mapped attribute of the specified target type belonging to any entity in the persistence unit, except for attributes for which conversion is overridden by means of the Convert annotation (or XML equivalent). The Convert annotation may be used to override or disable auto-apply conversion on a per-attribute basis.

If autoApply = false, the converter applies only to attributes of the target type for which conversion is explicitly enabled via the Convert annotation (or corresponding XML element).

If there is more than one converter defined for the same target type, Convert#converter must be used to explicitly specify which converter applies.

Since
2.1
See Also
AttributeConverter, Convert

Method Summary

Modifier and TypeMethod and Description
public boolean
autoApply()

Specifies whether the annotated converter should be automatically applied to attributes of the target type.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

autoApplyback to summary
public boolean autoApply()

Specifies whether the annotated converter should be automatically applied to attributes of the target type.