post_img

11-连接池整合

摘要

连接池整合 创建一个数据源工厂,继承UnpooledDataSourceFactory,在构造方法中指定数据库连接池对象即可,具体 …

post_img

10-分页器插件

摘要

分页器插件 PageHelper是MyBatis的一个插件,用于简化分页查询操作,支持常见的12种数据库,支持多种分页方式 获取P …

post_img

09-缓存

摘要

缓存 MyBatis为了提高查询效率和减去数据库的压力,提供了缓存机制,底层使用Map数据结构实现缓存的存储 一级缓存 一级缓存M …

post_img

07-批处理

摘要

批处理 xml方式 批处理方式无法执行回写操作 <insert id=”batchInsert” parameterTy …

post_img

06-动态SQL

摘要

动态SQL xml方式 <select id=”dynamicSQL” parameterType=”java.util …

post_img

03-SQL参数映射

摘要

SQL参数映射 xml方式 <!– parameterType属性用于限制接收参数类型,并且只能有一个paramete …

post_img

02-使用方式

摘要

使用方式 创建MyBatis全局配置文件,一般命名为mybatis-config.xml,填写以下配置信息 <?xml …