Annotation Type Convert


@Retention(RUNTIME) @Target({METHOD,FIELD}) public @interface Convert
Specifies that a given type should be converted before being stored to, and after being retrieved from the datastore using the given AttributeConverter. If this annotation is placed on a type, then the conversion applies to all fields or properties whose types match the entity type of the given AttributeConverter. Any Convert annotations placed on members overrides any type-level conversion specifications. If this annotation is placed on a field or property, the annotated attribute's type must be assignment-compatible with the AttributeConverter's entity type argument.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The AttributeConverter to use for conversion.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether this conversion is enabled.
  • Element Details

    • value

      Class<? extends AttributeConverter> value
      The AttributeConverter to use for conversion.
      Returns:
      Converter class to use
    • enabled

      boolean enabled
      Whether this conversion is enabled. True by default. Setting this to false allows disabling conversion that was specified at PMF level.
      Returns:
      Whether the PMF default converter is enabled
      Default:
      true