Class AbstractMethod
java.lang.Object
com.baomidou.mybatisplus.core.injector.AbstractMethod
- All Implemented Interfaces:
Constants,StringPool,Serializable
- Direct Known Subclasses:
Delete,DeleteById,DeleteByIds,DeleteByMap,Insert,SelectById,SelectByIds,SelectByMap,SelectCount,SelectList,SelectMaps,SelectMapsPage,SelectObjs,SelectOne,SelectPage,Update,UpdateById
抽象的注入方法类
- Since:
- 2018-04-06
- Author:
- hubin
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.ibatis.builder.MapperBuilderAssistantprotected org.apache.ibatis.session.Configurationprotected org.apache.ibatis.scripting.LanguageDriverprotected final org.apache.ibatis.logging.Logprotected final String方法名称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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.ibatis.mapping.MappedStatementaddDeleteMappedStatement(Class<?> mapperClass, String id, org.apache.ibatis.mapping.SqlSource sqlSource) 删除protected org.apache.ibatis.mapping.MappedStatementaddDeleteMappedStatement(Class<?> mapperClass, org.apache.ibatis.mapping.SqlSource sqlSource) protected org.apache.ibatis.mapping.MappedStatementaddInsertMappedStatement(Class<?> mapperClass, Class<?> parameterType, String id, org.apache.ibatis.mapping.SqlSource sqlSource, org.apache.ibatis.executor.keygen.KeyGenerator keyGenerator, String keyProperty, String keyColumn) 插入protected org.apache.ibatis.mapping.MappedStatementaddInsertMappedStatement(Class<?> mapperClass, Class<?> parameterType, org.apache.ibatis.mapping.SqlSource sqlSource, org.apache.ibatis.executor.keygen.KeyGenerator keyGenerator, String keyProperty, String keyColumn) 插入protected org.apache.ibatis.mapping.MappedStatementaddMappedStatement(Class<?> mapperClass, String id, org.apache.ibatis.mapping.SqlSource sqlSource, org.apache.ibatis.mapping.SqlCommandType sqlCommandType, Class<?> parameterType, String resultMap, Class<?> resultType, org.apache.ibatis.executor.keygen.KeyGenerator keyGenerator, String keyProperty, String keyColumn) 添加 MappedStatement 到 Mybatis 容器protected org.apache.ibatis.mapping.MappedStatementaddMappedStatement(Class<?> mapperClass, org.apache.ibatis.mapping.SqlSource sqlSource, org.apache.ibatis.mapping.SqlCommandType sqlCommandType, Class<?> parameterType, String resultMap, Class<?> resultType, org.apache.ibatis.executor.keygen.KeyGenerator keyGenerator, String keyProperty, String keyColumn) protected org.apache.ibatis.mapping.MappedStatementaddSelectMappedStatementForOther(Class<?> mapperClass, String id, org.apache.ibatis.mapping.SqlSource sqlSource, Class<?> resultType) 查询protected org.apache.ibatis.mapping.MappedStatementaddSelectMappedStatementForOther(Class<?> mapperClass, org.apache.ibatis.mapping.SqlSource sqlSource, Class<?> resultType) 查询protected org.apache.ibatis.mapping.MappedStatementaddSelectMappedStatementForTable(Class<?> mapperClass, String id, org.apache.ibatis.mapping.SqlSource sqlSource, TableInfo table) 查询protected org.apache.ibatis.mapping.MappedStatementaddSelectMappedStatementForTable(Class<?> mapperClass, org.apache.ibatis.mapping.SqlSource sqlSource, TableInfo table) 查询protected org.apache.ibatis.mapping.MappedStatementaddUpdateMappedStatement(Class<?> mapperClass, Class<?> parameterType, String id, org.apache.ibatis.mapping.SqlSource sqlSource) 更新protected org.apache.ibatis.mapping.MappedStatementaddUpdateMappedStatement(Class<?> mapperClass, Class<?> parameterType, org.apache.ibatis.mapping.SqlSource sqlSource) 更新protected StringconvertChooseEwSelect(String otherwise) protected StringconvertIfEwParam(String param, boolean newLine) org.apache.ibatis.mapping.SqlSourcecreateSqlSource(org.apache.ibatis.session.Configuration configuration, String script, Class<?> parameterType) protected StringfilterTableFieldInfo(List<TableFieldInfo> fieldList, Predicate<TableFieldInfo> predicate, Function<TableFieldInfo, String> function, String joiningVal) 过滤 TableFieldInfo 集合, join 成字符串voidinject(org.apache.ibatis.builder.MapperBuilderAssistant builderAssistant, Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) 注入自定义方法abstract org.apache.ibatis.mapping.MappedStatementinjectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) 注入自定义 MappedStatementprotected StringoptlockVersion(TableInfo tableInfo) 获取乐观锁相关protected StringSQL 注释protected StringsqlCount()SQL 查询记录行数protected StringsqlFirst()SQL 注释protected StringsqlLogicSet(TableInfo table) SQL 更新 set 语句protected StringsqlOrderBy(TableInfo tableInfo) protected StringsqlSelectColumns(TableInfo table, boolean queryWrapper) SQL 查询所有表字段protected StringsqlSelectObjsColumns(TableInfo table) SQL 设置selectObj sql selectprotected StringsqlSet(boolean logic, boolean ew, TableInfo table, boolean judgeAliasNull, String alias, String prefix) SQL 更新 set 语句protected StringsqlWhereByMap(TableInfo table) Deprecated.protected StringsqlWhereEntityWrapper(boolean newLine, TableInfo table) EntityWrapper方式获取select where
-
Field Details
-
logger
protected final org.apache.ibatis.logging.Log logger -
configuration
protected org.apache.ibatis.session.Configuration configuration -
languageDriver
protected org.apache.ibatis.scripting.LanguageDriver languageDriver -
builderAssistant
protected org.apache.ibatis.builder.MapperBuilderAssistant builderAssistant -
methodName
方法名称- Since:
- 3.5.0
-
-
Constructor Details
-
AbstractMethod
- Parameters:
methodName- 方法名- Since:
- 3.5.0
-
-
Method Details
-
inject
public void inject(org.apache.ibatis.builder.MapperBuilderAssistant builderAssistant, Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) 注入自定义方法 -
sqlLogicSet
SQL 更新 set 语句- Parameters:
table- 表信息- Returns:
- sql set 片段
-
sqlSet
protected String sqlSet(boolean logic, boolean ew, TableInfo table, boolean judgeAliasNull, String alias, String prefix) SQL 更新 set 语句- Parameters:
logic- 是否逻辑删除注入器ew- 是否存在 UpdateWrapper 条件table- 表信息alias- 别名prefix- 前缀- Returns:
- sql
-
sqlComment
SQL 注释- Returns:
- sql
-
sqlFirst
SQL 注释- Returns:
- sql
-
convertIfEwParam
-
sqlSelectColumns
SQL 查询所有表字段- Parameters:
table- 表信息queryWrapper- 是否为使用 queryWrapper 查询- Returns:
- sql 脚本
-
sqlCount
SQL 查询记录行数- Returns:
- count sql 脚本
-
sqlSelectObjsColumns
SQL 设置selectObj sql select- Parameters:
table- 表信息
-
convertChooseEwSelect
-
sqlWhereByMap
Deprecated.SQL map 查询条件 -
sqlWhereEntityWrapper
EntityWrapper方式获取select where- Parameters:
newLine- 是否提到下一行table- 表信息- Returns:
- String
-
sqlOrderBy
-
filterTableFieldInfo
protected String filterTableFieldInfo(List<TableFieldInfo> fieldList, Predicate<TableFieldInfo> predicate, Function<TableFieldInfo, String> function, String joiningVal) 过滤 TableFieldInfo 集合, join 成字符串 -
optlockVersion
获取乐观锁相关- Parameters:
tableInfo- 表信息- Returns:
- String
-
addSelectMappedStatementForTable
protected org.apache.ibatis.mapping.MappedStatement addSelectMappedStatementForTable(Class<?> mapperClass, String id, org.apache.ibatis.mapping.SqlSource sqlSource, TableInfo table) 查询 -
addSelectMappedStatementForTable
protected org.apache.ibatis.mapping.MappedStatement addSelectMappedStatementForTable(Class<?> mapperClass, org.apache.ibatis.mapping.SqlSource sqlSource, TableInfo table) 查询- Since:
- 3.5.0
-
addSelectMappedStatementForOther
protected org.apache.ibatis.mapping.MappedStatement addSelectMappedStatementForOther(Class<?> mapperClass, String id, org.apache.ibatis.mapping.SqlSource sqlSource, Class<?> resultType) 查询 -
addSelectMappedStatementForOther
protected org.apache.ibatis.mapping.MappedStatement addSelectMappedStatementForOther(Class<?> mapperClass, org.apache.ibatis.mapping.SqlSource sqlSource, Class<?> resultType) 查询- Since:
- 3.5.0
-
addInsertMappedStatement
protected org.apache.ibatis.mapping.MappedStatement addInsertMappedStatement(Class<?> mapperClass, Class<?> parameterType, String id, org.apache.ibatis.mapping.SqlSource sqlSource, org.apache.ibatis.executor.keygen.KeyGenerator keyGenerator, String keyProperty, String keyColumn) 插入 -
addInsertMappedStatement
protected org.apache.ibatis.mapping.MappedStatement addInsertMappedStatement(Class<?> mapperClass, Class<?> parameterType, org.apache.ibatis.mapping.SqlSource sqlSource, org.apache.ibatis.executor.keygen.KeyGenerator keyGenerator, String keyProperty, String keyColumn) 插入- Since:
- 3.5.0
-
addDeleteMappedStatement
protected org.apache.ibatis.mapping.MappedStatement addDeleteMappedStatement(Class<?> mapperClass, String id, org.apache.ibatis.mapping.SqlSource sqlSource) 删除 -
addDeleteMappedStatement
protected org.apache.ibatis.mapping.MappedStatement addDeleteMappedStatement(Class<?> mapperClass, org.apache.ibatis.mapping.SqlSource sqlSource) - Since:
- 3.5.0
-
addUpdateMappedStatement
protected org.apache.ibatis.mapping.MappedStatement addUpdateMappedStatement(Class<?> mapperClass, Class<?> parameterType, String id, org.apache.ibatis.mapping.SqlSource sqlSource) 更新 -
addUpdateMappedStatement
protected org.apache.ibatis.mapping.MappedStatement addUpdateMappedStatement(Class<?> mapperClass, Class<?> parameterType, org.apache.ibatis.mapping.SqlSource sqlSource) 更新- Since:
- 3.5.0
-
addMappedStatement
protected org.apache.ibatis.mapping.MappedStatement addMappedStatement(Class<?> mapperClass, String id, org.apache.ibatis.mapping.SqlSource sqlSource, org.apache.ibatis.mapping.SqlCommandType sqlCommandType, Class<?> parameterType, String resultMap, Class<?> resultType, org.apache.ibatis.executor.keygen.KeyGenerator keyGenerator, String keyProperty, String keyColumn) 添加 MappedStatement 到 Mybatis 容器 -
addMappedStatement
protected org.apache.ibatis.mapping.MappedStatement addMappedStatement(Class<?> mapperClass, org.apache.ibatis.mapping.SqlSource sqlSource, org.apache.ibatis.mapping.SqlCommandType sqlCommandType, Class<?> parameterType, String resultMap, Class<?> resultType, org.apache.ibatis.executor.keygen.KeyGenerator keyGenerator, String keyProperty, String keyColumn) - Since:
- 3.5.0
-
injectMappedStatement
public abstract org.apache.ibatis.mapping.MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) 注入自定义 MappedStatement- Parameters:
mapperClass- mapper 接口modelClass- mapper 泛型tableInfo- 数据库表反射信息- Returns:
- MappedStatement
-
createSqlSource
public org.apache.ibatis.mapping.SqlSource createSqlSource(org.apache.ibatis.session.Configuration configuration, String script, Class<?> parameterType) - Parameters:
configuration- 配置对象script- (统一去除空白行)parameterType- 参数类型- Returns:
- SqlSource
- Since:
- 3.5.3.2
-