Annotation Type CopeSchemaValue


@Target(FIELD) @Retention(RUNTIME) public @interface CopeSchemaValue
Specifies the schema value (an integer) of an enum facet stored in the column of an EnumField. This may be useful to maintain schema compatibility to former versions of the application or to a legacy application.

Schema values of enum facets are assigned by the following rules:

  • An annotated facet (by CopeSchemaValue) gets the schema value specified by the annotation.
  • A non-annotated facet, that is the first facet of its Enum, gets a schema value of 10.
  • Otherwise, a non-annotated facet gets the schema value of the previous facet, plus one, rounded to full multiples of 10 towards Integer.MAX_VALUE. This holds regardless whether the previous facet is annotated or not.
If, by the rules above, a facet is assigned a schema value, that is not greater than the schema value of its previous facet, EnumField.create throws an IllegalArgumentException. This means you can't change the order of enums with this annotation.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    int
     
  • Element Details

    • value

      int value