@Target(value={METHOD,FIELD}) @Retention(value=RUNTIME) @Documented public @interface Column
Examples:
Example 1:
@Column(name="DESC", nullable=false)
private String description;
Example 2:
@Column(name="id", primaryKey=true)
public String getId() { return id; }
Example 3:
@Column(name="ORDER_COST", insertable=false, updatable=false)
private String cost;
| Modifier and Type | Optional Element and Description |
|---|---|
String |
escapedName
(Optional) 编码之后的字段名,比如:字段名是关键字、有空格
|
FillRule[] |
fillRule
用于 SQL 语句在 INSERT/UPDATE 的时候,字段是否需要进行填充,参考
FillRule 的详细说明 |
boolean |
insertable
字段是否包含在 SQL INSERT statements,某些字段不想被保存
|
boolean |
isTransient
标记字段为普通字段,不是数据库字段
|
boolean |
logicDelete
逻辑删除数据,软删除,用字段标记数据被删除了,不做物理删除
|
String |
logicDeleteValue
数据标记为"逻辑删除"的值
|
String |
logicUnDeleteValue
数据标记为"逻辑未删除"的值
|
String |
name
(Optional) The name of the column.
|
boolean |
nullable
(Optional) Whether the database column is nullable.
|
boolean |
primaryKey
是否为主键字段
|
boolean |
selectable
字段是否包含在 SQL SELECT statements,某些字段不想被查询出来
|
Class<? extends org.apache.ibatis.type.TypeHandler<?>> |
typeHandler
数据库字段类型转换为Java类型处理器
|
boolean |
updatable
字段是否包含在 SQL UPDATE statements,某些字段不想被更新
|
public abstract String name
public abstract String escapedName
public abstract boolean nullable
nullpublic abstract boolean insertable
(Optional) Whether the column is included in SQL INSERT statements generated by the persistence provider.
public abstract boolean updatable
(Optional) Whether the column is included in SQL UPDATE statements generated by the persistence provider.
public abstract boolean selectable
(Optional) Whether the column is included in SQL SELECT statements generated by the persistence provider.
public abstract boolean logicDelete
public abstract String logicDeleteValue
public abstract String logicUnDeleteValue
public abstract Class<? extends org.apache.ibatis.type.TypeHandler<?>> typeHandler
Copyright © 2018–2021. All rights reserved.