Annotation Interface Column


@Target({METHOD,FIELD}) @Retention(RUNTIME) public @interface Column
Describes a column of the table. Type of the column is derived from the type of the annotated field or method.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Full SQL definition of the column type without the name, mutually exclusive with other options.
    int
    The length of the string type.
    boolean
    Whether this column is nullable or not.
    int
    The precision of the numeric type.
    int
    The scale of the numeric type.
    The name of the column.
  • Element Details

    • value

      String value
      The name of the column. By default the name of the field or method is used.
      Returns:
      The name of the column.
      Default:
      ""
    • nullable

      boolean nullable
      Whether this column is nullable or not. By default the column is nullable.
      Returns:
      true if column is nullable.
      Default:
      true
    • length

      int length
      The length of the string type.
      Returns:
      The length of the string type.
      Default:
      -1
    • precision

      int precision
      The precision of the numeric type.
      Returns:
      The precision of the numeric type.
      Default:
      -1
    • scale

      int scale
      The scale of the numeric type.
      Returns:
      The scale of the numeric type.
      Default:
      -1
    • columnDefinition

      String columnDefinition
      Full SQL definition of the column type without the name, mutually exclusive with other options.
      Returns:
      SQL definition of the column type.
      Default:
      ""