Class TableFieldInfo
java.lang.Object
com.baomidou.mybatisplus.core.metadata.TableFieldInfo
- All Implemented Interfaces:
Constants,StringPool,Serializable
数据库表字段反射信息
- Since:
- 2016-09-09
- Author:
- hubin sjy willenfoo tantan
- See Also:
-
Field Summary
Fields inherited from interface com.baomidou.mybatisplus.core.toolkit.Constants
AES, AES_CBC_CIPHER, ARRAY, AS, ASC, COLL, COLLECTION, COLUMN_MAP, COLUMN_MAP_IS_EMPTY, DEFAULT_BATCH_SIZE, DESC, ENTITY, ENTITY_DOT, LIMIT, LIST, MD5, MP_FILL_ET, MP_OPTLOCK_VERSION_ORIGINAL, MYBATIS_PLUS, ORDER_BY, Q_WRAPPER_SQL_COMMENT, Q_WRAPPER_SQL_FIRST, Q_WRAPPER_SQL_SELECT, U_WRAPPER_SQL_SET, WHERE, WRAPPER, WRAPPER_DOT, WRAPPER_EMPTYOFNORMAL, WRAPPER_EMPTYOFWHERE, WRAPPER_ENTITY, WRAPPER_ENTITY_DOT, WRAPPER_EXPRESSION_ORDER, WRAPPER_NONEMPTYOFENTITY, WRAPPER_NONEMPTYOFNORMAL, WRAPPER_NONEMPTYOFWHERE, WRAPPER_PARAM, WRAPPER_PARAM_MIDDLE, WRAPPER_SQLSEGMENTFields inherited from interface com.baomidou.mybatisplus.core.toolkit.StringPool
AMPERSAND, AND, ASTERISK, AT, BACK_SLASH, BACKTICK, BYTES_NEW_LINE, COLON, COMMA, CRLF, DASH, DOLLAR, DOLLAR_LEFT_BRACE, DOT, DOT_CLASS, DOT_JAVA, DOT_NEWLINE, DOT_XML, DOTDOT, EMPTY, EMPTY_ARRAY, EQUALS, EXCLAMATION_MARK, FALSE, HASH, HASH_LEFT_BRACE, HAT, HTML_AMP, HTML_GT, HTML_LT, HTML_NBSP, HTML_QUOTE, ISO_8859_1, LEFT_BRACE, LEFT_BRACKET, LEFT_CHEV, LEFT_SQ_BRACKET, N, NEWLINE, NO, NULL, NUM, OFF, ON, ONE, PERCENT, PIPE, PLUS, QUESTION_MARK, QUOTE, RETURN, RIGHT_BRACE, RIGHT_BRACKET, RIGHT_CHEV, RIGHT_SQ_BRACKET, SELECT_WITH_CURSOR, SEMICOLON, SINGLE_QUOTE, SLASH, SPACE, SQL, STAR, TAB, TILDA, TRUE, UNDERSCORE, US_ASCII, UTF_8, Y, YES, ZERO -
Constructor Summary
ConstructorsConstructorDescriptionTableFieldInfo(GlobalConfig globalConfig, TableInfo tableInfo, Field field, com.baomidou.mybatisplus.annotation.TableField tableField, org.apache.ibatis.reflection.Reflector reflector, boolean existTableLogic) 全新的 存在 TableField 注解时使用的构造函数TableFieldInfo(GlobalConfig globalConfig, TableInfo tableInfo, Field field, com.baomidou.mybatisplus.annotation.TableField tableField, org.apache.ibatis.reflection.Reflector reflector, boolean existTableLogic, boolean isOrderBy) 全新的 存在 TableField 注解时使用的构造函数TableFieldInfo(GlobalConfig globalConfig, TableInfo tableInfo, Field field, org.apache.ibatis.reflection.Reflector reflector, boolean existTableLogic) 不存在 TableField 注解时, 使用的构造函数TableFieldInfo(GlobalConfig globalConfig, TableInfo tableInfo, Field field, org.apache.ibatis.reflection.Reflector reflector, boolean existTableLogic, boolean isOrderBy) 不存在 TableField 注解时, 使用的构造函数 -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanboolean字段名getColumnValue(String value) 获取字段值where 字段比较条件getEl()属性表达式#{property}, 可以指定jdbcType, typeHandler等getField()属性com.baomidou.mybatisplus.annotation.FieldFill字段填充策略获取 insert 时候字段 sql 脚本片段getInsertSqlColumnMaybeIf(String prefix) 获取 insert 时候字段 sql 脚本片段getInsertSqlProperty(String prefix) 获取 insert 时候插入值 sql 脚本片段getInsertSqlPropertyMaybeIf(String prefix) 获取 insert 时候插入值 sql 脚本片段com.baomidou.mybatisplus.annotation.FieldStrategy字段验证策略之 insert Refer toTableField.insertStrategy()org.apache.ibatis.type.JdbcTypeJDBC类型逻辑删除值逻辑未删除值jdbcType, typeHandler等部分short排序顺序排序类型属性名Class<?> 属性类型缓存 sql select获取 set sql 片段获取 set sql 片段getSqlWhere(String prefix) 获取 查询的 sql 片段Class<? extends org.apache.ibatis.type.TypeHandler<?>> 类型处理器字段 update set 部分注入com.baomidou.mybatisplus.annotation.FieldStrategy字段验证策略之 update Refer toTableField.updateStrategy()getVersionOli(String alias, String prefix) com.baomidou.mybatisplus.annotation.FieldStrategy字段验证策略之 where Refer toTableField.whereStrategy()inthashCode()boolean属性是否是 CharSequence 类型boolean是否是逻辑删除字段boolean是否存在OrderBy注解boolean是否是基本数据类型booleanisSelect()是否进行 select 查询boolean是否是乐观锁字段boolean表字段是否启用了插入填充boolean表字段是否启用了更新填充toString()
-
Constructor Details
-
TableFieldInfo
public TableFieldInfo(GlobalConfig globalConfig, TableInfo tableInfo, Field field, com.baomidou.mybatisplus.annotation.TableField tableField, org.apache.ibatis.reflection.Reflector reflector, boolean existTableLogic, boolean isOrderBy) 全新的 存在 TableField 注解时使用的构造函数 -
TableFieldInfo
public TableFieldInfo(GlobalConfig globalConfig, TableInfo tableInfo, Field field, com.baomidou.mybatisplus.annotation.TableField tableField, org.apache.ibatis.reflection.Reflector reflector, boolean existTableLogic) 全新的 存在 TableField 注解时使用的构造函数 -
TableFieldInfo
public TableFieldInfo(GlobalConfig globalConfig, TableInfo tableInfo, Field field, org.apache.ibatis.reflection.Reflector reflector, boolean existTableLogic, boolean isOrderBy) 不存在 TableField 注解时, 使用的构造函数 -
TableFieldInfo
public TableFieldInfo(GlobalConfig globalConfig, TableInfo tableInfo, Field field, org.apache.ibatis.reflection.Reflector reflector, boolean existTableLogic) 不存在 TableField 注解时, 使用的构造函数
-
-
Method Details
-
getColumnValue
获取字段值 -
getInsertSqlProperty
获取 insert 时候插入值 sql 脚本片段insert into table (字段) values (值)
位于 "值" 部位
- 不生成 if 标签
- Returns:
- sql 脚本片段
-
getInsertSqlPropertyMaybeIf
获取 insert 时候插入值 sql 脚本片段insert into table (字段) values (值)
位于 "值" 部位
- 根据规则会生成 if 标签
- Returns:
- sql 脚本片段
-
getInsertSqlColumn
获取 insert 时候字段 sql 脚本片段insert into table (字段) values (值)
位于 "字段" 部位
- 不生成 if 标签
- Returns:
- sql 脚本片段
-
getInsertSqlColumnMaybeIf
获取 insert 时候字段 sql 脚本片段insert into table (字段) values (值)
位于 "字段" 部位
- 根据规则会生成 if 标签
- Returns:
- sql 脚本片段
-
getSqlSet
获取 set sql 片段- Parameters:
prefix- 前缀- Returns:
- sql 脚本片段
-
getSqlSet
获取 set sql 片段- Parameters:
ignoreIf- 忽略 IF 包裹prefix- 前缀- Returns:
- sql 脚本片段
-
getSqlWhere
获取 查询的 sql 片段- Parameters:
prefix- 前缀- Returns:
- sql 脚本片段
-
getVersionOli
-
getField
属性- Since:
- 3.3.1
-
getColumn
字段名 -
getProperty
属性名 -
getEl
属性表达式#{property}, 可以指定jdbcType, typeHandler等 -
getMapping
jdbcType, typeHandler等部分 -
getPropertyType
属性类型 -
isPrimitive
public boolean isPrimitive()是否是基本数据类型- Since:
- 3.4.0 @2020-6-19
-
isCharSequence
public boolean isCharSequence()属性是否是 CharSequence 类型 -
getInsertStrategy
public com.baomidou.mybatisplus.annotation.FieldStrategy getInsertStrategy()字段验证策略之 insert Refer toTableField.insertStrategy()- Since:
- added v_3.1.2 @2019-5-7
-
getUpdateStrategy
public com.baomidou.mybatisplus.annotation.FieldStrategy getUpdateStrategy()字段验证策略之 update Refer toTableField.updateStrategy()- Since:
- added v_3.1.2 @2019-5-7
-
getWhereStrategy
public com.baomidou.mybatisplus.annotation.FieldStrategy getWhereStrategy()字段验证策略之 where Refer toTableField.whereStrategy()- Since:
- added v_3.1.2 @2019-5-7
-
isVersion
public boolean isVersion()是否是乐观锁字段 -
isSelect
public boolean isSelect()是否进行 select 查询大字段可设置为 false 不加入 select 查询范围
-
getLogicDeleteValue
逻辑删除值 -
getLogicNotDeleteValue
逻辑未删除值 -
getUpdate
字段 update set 部分注入 -
getCondition
where 字段比较条件 -
getFieldFill
public com.baomidou.mybatisplus.annotation.FieldFill getFieldFill()字段填充策略 -
isWithInsertFill
public boolean isWithInsertFill()表字段是否启用了插入填充- Since:
- 3.3.0
-
isWithUpdateFill
public boolean isWithUpdateFill()表字段是否启用了更新填充- Since:
- 3.3.0
-
getSqlSelect
缓存 sql select -
getJdbcType
public org.apache.ibatis.type.JdbcType getJdbcType()JDBC类型- Since:
- 3.1.2
-
getTypeHandler
类型处理器- Since:
- 3.1.2
-
isOrderBy
public boolean isOrderBy()是否存在OrderBy注解 -
getOrderByType
排序类型 -
getOrderBySort
public short getOrderBySort()排序顺序 -
toString
-
equals
-
canEqual
-
hashCode
public int hashCode() -
isLogicDelete
public boolean isLogicDelete()是否是逻辑删除字段
-