注释接口 Column


@Retention(RUNTIME) @Target(allowedTargets=PROPERTY) @Target(METHOD) public @interface Column
Optional annotation to specify the column name for scalar properties.

If the column name inferred according to the Java/Kotlin property name based on Rule `word1Word2...WordN -> WORD1_WORD2_..._WORDN` is different from the column name in the database, this annotation must be used.

Note: This annotation can not be used to map foreign key. For foreign key, JoinColumn is useful

  • 元素详细资料

    • name

      String name
      默认值:
      ""
    • sqlType

      String sqlType
      For non-array column
      If these two conditions are matched
      1. The `any(?)` is supported by database, that is, `Dialect.isAnyOfArraySupported()` returns true
      2. The `sqlType` of this annotation is specified, or the current property returns `long` or `Long`
      , the in-collection predicate will be optimized. For example:
      where(table.id().in(Arrays.asList(1L, 2L, 3L, 4L)))
      generate the SQL
      where tb_1_.ID = any(?)
      • If the property type is `long` or `Long`, it will be considered as `bigint`
      • Otherwise, please specify it manually
      默认值:
      ""
    • sqlElementType

      String sqlElementType
      For array column
      默认值:
      ""