批注类型 DefaultValue


@Documented @Retention(RUNTIME) @Target({FIELD,ANNOTATION_TYPE}) public @interface DefaultValue
设置数据插入的时候的默认值
作者:
don
  • 必需元素概要

    所需元素
    修饰符和类型
    必需的元素
    说明
    数据插入的时候,默认的值,如果该值为时间类型,需要设置时间格式 默认值支持16种格式,如下: String, Integer, int, Long, long, Boolean, boolean, Double, double, Float, float, BigDecimal, Date, LocalDate, LocalDateTime, 枚举(仅支持枚举的名字作为默认值)
  • 可选元素概要

    可选元素
    修饰符和类型
    可选元素
    说明
    字段填充时机,默认只有插入逻辑触发
    如果字段类型为时间类型(Date,LocalDateTime等),需要制定字符串格式
  • 元素详细资料

    • value

      String value
      数据插入的时候,默认的值,如果该值为时间类型,需要设置时间格式 默认值支持16种格式,如下: String, Integer, int, Long, long, Boolean, boolean, Double, double, Float, float, BigDecimal, Date, LocalDate, LocalDateTime, 枚举(仅支持枚举的名字作为默认值)
    • format

      String format
      如果字段类型为时间类型(Date,LocalDateTime等),需要制定字符串格式
      默认值:
      "yyyy-MM-dd HH:mm:ss"
    • fill

      FieldFill fill
      字段填充时机,默认只有插入逻辑触发
      默认值:
      INSERT