Annotation Interface Column


@Documented @Retention(RUNTIME) @Target(FIELD) public @interface Column
Represents a database column mapping for an entity field in the custom ORM framework.

This annotation is used to specify metadata for a field that corresponds to a database column, such as its name, nullability, and uniqueness constraints.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Specifies the name of the database column.
    boolean
    Indicates whether the column can have null values.
    boolean
    Specifies whether the column should have a unique constraint.
  • Element Details

    • name

      String name
      Specifies the name of the database column.

      If left empty, the field's name will be used as the column name by default.

      Returns:
      The name of the column.
      Default:
      ""
    • nullable

      boolean nullable
      Indicates whether the column can have null values.

      Defaults to true, meaning the column allows null values unless explicitly set to false.

      Returns:
      true if the column allows null values, otherwise false.
      Default:
      true
    • unique

      boolean unique
      Specifies whether the column should have a unique constraint.

      Defaults to false, meaning the column is not unique unless explicitly set to true.

      Returns:
      true if the column must have unique values, otherwise false.
      Default:
      false