创建Executor执行器,用来执行 SQL 语句,在创建会话工厂SqlSessionFactory的时候就会创建一个Executor,其默认执行器类型是ExecutorType.SIMPLE; MappedStatement对象,该对象是Executor执行器方法中的参数,主要是对 Mapper XML 文件中映射信息的封装; 输入参数映射; 输出参数映射。 依赖及配置 创建Spring Boot 项目,在其 build...
1、使用企业级模块 <dependency><!--MyBatis-Plus 企业级模块--><groupId>com.baomidou</groupId><artifactId>mybatis-mate-starter</artifactId><version>1.2.8</version></dependency> 进行字段脱敏 2、@FieldSensitive(type = SensitiveType.chineseName) publicinterfaceSensitiveType{StringchineseName="chineseN...
ExecutorType executorType = this.properties.getExecutorType(); return executorType != null ? new SqlSessionTemplate(sqlSessionFactory, executorType) : new SqlSessionTemplate(sqlSessionFactory); } @Configuration @Import({MybatisPlusAutoConfiguration.AutoConfiguredMapperScannerRegistrar.class}) @ConditionalOnMis...
public Executor newExecutor(Transaction transaction, ExecutorType executorType) { executorType = executorType == null ? defaultExecutorType : executorType; executorType = executorType == null ? ExecutorType.SIMPLE : executorType; Executor executor; if (ExecutorType.BATCH == executorType) { executor ...
// 创建Executor final Executor executor = configuration.newExecutor(tx, execType); return new DefaultSqlSession(configuration, executor, autoCommit); } catch (Exception e) {...} finally {...} } com.baomidou.mybatisplus.core.MybatisConfiguration#newExecutor ...
executorType= executorType ==null?this.defaultExecutorType : executorType; executorType= executorType ==null?ExecutorType.SIMPLE : executorType; Object executor;if(ExecutorType.BATCH == executorType) {//批量执行器BatchExecutorexecutor =newMybatisBatchExecutor(this, transaction); ...
语句 default-executor-type: REUSE configuration: # 是否开启自动驼峰命名规则(camel case)映射,即从经典数据库列名 A_COLUMN(下划线命名) 到经典 Java 属性名 aColumn(驼峰命名) 的类似映射 map-underscore-to-camel-case: true # 全局地开启或关闭配置文件中的所有映射器已经配置的任何缓存,默认为 true cache-...
defaultEnumTypeHandler: com.baomidou.mybatisplus.extension.handlers.MybatisEnumTypeHandler # 配置JdbcTypeForNull, oracle数据库必须配置 jdbc-type-for-null: null global-config: # 全局策略配置 # 是否控制台 print mybatis-plus 的 LOGO banner: false db-config: # id类型 id-type ...
<setting name="defaultExecutorType" value="REUSE" /> <!-- 数据库超过600秒仍未响应则超时 --> <setting name="defaultStatementTimeout" value="600" /> <!-- 设置但JDBC类型为空时,某些驱动程序 要指定值,default:OTHER --> <setting name="jdbcTypeForNull" value="NULL" /> ...
原理:充分利用mybatis-plus的typeHandle+拒绝反射 代码语言:javascript 复制 //这个是处理mybatis-plus的序列化的主要类packageorg.apache.ibatis.executor.resultset.DefaultResultSetHandler;//关键1:将typeHandler的集合做一个缓存privatevoidhandleRowValuesForSimpleResultMap(ResultSetWrapper rsw,ResultMap resultMap,Resul...