public class EntityColumn extends EntityProps<EntityColumn>
| Modifier and Type | Field and Description |
|---|---|
protected String |
afterSql
主键策略2,优先级2:取主键的 SQL,当前SQL只能在 INSERT 语句执行后执行,如果想要在 INSERT 语句执行前执行,可以使用
genId |
protected String |
column
列名
|
protected EntityTable |
entityTable
所在实体类
|
protected EntityField |
field
实体类字段
|
protected Class<? extends GenId> |
genId
主键策略3,优先级3:Java 方式生成主键,可以和发号器一类的服务配合使用
|
protected boolean |
genIdExecuteBefore
执行 genId 的时机,仅当
genId 不为空时有效,默认插入前执行 |
protected boolean |
id
是否为主键
|
protected boolean |
insertable
是否插入字段
|
protected org.apache.ibatis.type.JdbcType |
jdbcType
jdbc类型
|
protected String |
numericScale
精度
|
protected String |
orderBy
排序方式
|
protected int |
orderByPriority
排序的优先级,数值越小优先级越高
|
protected boolean |
selectable
是否查询字段
|
protected Class<? extends org.apache.ibatis.type.TypeHandler> |
typeHandler
类型处理器
|
protected boolean |
updatable
是否更新字段
|
protected boolean |
useGeneratedKeys
主键策略1,优先级1:是否使用 JDBC 方式获取主键,优先级最高,设置为 true 后,不对其他配置校验
|
props| Modifier | Constructor and Description |
|---|---|
protected |
EntityColumn(EntityField field) |
| Modifier and Type | Method and Description |
|---|---|
String |
columnAsProperty()
返回 column AS property 形式的字符串, 当 column 和 property 相同时没有别名
|
String |
columnAsProperty(String prefix)
返回 column AS prefixproperty 形式的字符串
|
String |
columnEqualsProperty()
返回 column = #{property} 形式的字符串
|
String |
columnEqualsProperty(String prefix)
返回带前缀的 column = #{prefixproperty} 形式的字符串
|
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
hasPrimaryKeyStrategy()
当前字段是否设置了主键策略
|
Class<?> |
javaType()
Java 类型
|
Optional<String> |
jdbcTypeVariables()
数据库类型 {, jdbcType=VARCHAR}
|
String |
notEmptyTest()
当字段类型为 String 时,返回 property != null and property != '' 形式的字符串.
|
String |
notEmptyTest(String prefix)
当字段类型为 String 时,返回 prefixproperty != null and prefixproperty != '' 形式的字符串.
|
String |
notNullTest()
返回 property != null 形式的字符串
|
String |
notNullTest(String prefix)
返回带前缀的 prefixproperty != null 形式的字符串
|
Optional<String> |
numericScaleVariables()
小数位数 {, numericScale=2}
|
static EntityColumn |
of(EntityField field) |
String |
property()
属性名
|
String |
property(String prefix)
带指定前缀的属性名
|
String |
toString() |
Optional<String> |
typeHandlerVariables()
类型处理器 {, typeHandler=XXTypeHandler}
|
String |
variables()
返回 xml 变量形式 #{property}
|
String |
variables(String prefix)
返回带前缀的 xml 变量形式 #{prefixproperty}
|
getProp, getProp, getPropBoolean, getPropBoolean, getPropInt, getPropInt, removeProp, setProp, setProp, setPropsprotected final EntityField field
protected EntityTable entityTable
protected String column
protected boolean id
protected boolean useGeneratedKeys
protected String afterSql
genIdprotected boolean genIdExecuteBefore
genId 不为空时有效,默认插入前执行protected String orderBy
protected int orderByPriority
protected boolean selectable
protected boolean insertable
protected boolean updatable
protected org.apache.ibatis.type.JdbcType jdbcType
protected Class<? extends org.apache.ibatis.type.TypeHandler> typeHandler
protected String numericScale
protected EntityColumn(EntityField field)
public static EntityColumn of(EntityField field)
public Class<?> javaType()
public String property()
public String variables()
public String variables(String prefix)
prefix - 指定前缀,需要自己提供"."public Optional<String> typeHandlerVariables()
public String columnAsProperty()
public String columnAsProperty(String prefix)
prefix - 指定前缀,需要自己提供"."public String columnEqualsProperty()
public String columnEqualsProperty(String prefix)
prefix - 指定前缀,需要自己提供"."public String notNullTest()
public String notNullTest(String prefix)
prefix - 指定前缀,需要自己提供"."public String notEmptyTest()
notNullTest() 方法一样.public String notEmptyTest(String prefix)
notNullTest() 方法一样.prefix - 指定前缀,需要自己提供"."public boolean hasPrimaryKeyStrategy()
Copyright © 2023. All rights reserved.