Annotation Interface Column


@Documented @Target(FIELD) @Retention(RUNTIME) public @interface Column
列定义注解。

标记在实体类字段上,用于指定数据库列的属性和约束。

Since:
1.0.0
Version:
1.0.0
Author:
Berry_so
  • Element Details

    • name

      String name
      列名。
      Returns:
      数据库列名,默认使用字段名
      Default:
      ""
    • primaryKey

      boolean primaryKey
      是否为主键。
      Returns:
      true 表示该列为主键,默认为 false
      Default:
      false
    • autoIncrement

      boolean autoIncrement
      是否自增。
      Returns:
      true 表示该列自增,默认为 false
      Default:
      false
    • nullable

      boolean nullable
      是否可为空。
      Returns:
      true 表示该列可为空,默认为 true
      Default:
      true
    • unique

      boolean unique
      是否唯一。
      Returns:
      true 表示该列有唯一约束,默认为 false
      Default:
      false
    • length

      int length
      列长度。
      Returns:
      列长度,-1 表示使用默认长度
      Default:
      -1
    • defaultValue

      String defaultValue
      默认值。
      Returns:
      列的默认值
      Default:
      ""
    • comment

      String comment
      列注释。
      Returns:
      列的注释说明
      Default:
      ""