mybatisplus 二级缓存
来源:互联网 发布:网络销售高仿酒 编辑:程序博客网 时间:2024/05/28 17:08
1将mybatisplus的全局配置的cache-enabled配置为true
mybatis-plus: dataSource: datasource mapper-locations: classpath:/mapper/*/*Mapper.xml typeAliasesPackage: com.wbst.modules.*.entity global-config: id-type: 2 field-strategy: 2 db-column-underline: true refresh-mapper: true configuration: map-underscore-to-camel-case: true cache-enabled: true
2在需要配置二级缓存的mapper映射文件如:test.xml加入如下配置:
<cache eviction="FIFO"
flushInterval="10800000"
size="512"
readOnly="true"
/>
这个最好写在开头位置,一般第一条查询语句前面的可以了
3有些select不想被缓存时,可以添加select的属性useCache=“false”
4将查询结果对应的java实体类实现序列化接口(implements Serializable)
阅读全文
0 0
- mybatisplus 二级缓存
- springboot整合mybatisplus配置
- SpringBoot集成MyBatisPlus
- Mybatisplus整合sharding-jdbc
- 二级缓存
- 二级缓存
- 二级缓存
- 二级缓存
- 二级缓存
- 二级缓存
- 二级缓存
- 二级缓存
- MyBatisPlus注入公共Sql问题
- 新手mybatisplus配置与使用个人记录
- 【sail】第三篇MybatisPlus的配置以及FreeMarker的配置
- 二级缓存容量
- hibernate 二级缓存
- hibernate 二级缓存
- 我的电路实践
- SAP Fiori Annotation 介绍
- UML四种关系
- HashMap
- spring依赖注入失效极度无语的,不知道为啥的
- mybatisplus 二级缓存
- 移动互联网实时视频通讯之视频采集
- 算一个数的二进制,以及最大值最小值技巧
- Node创建服务并加载静态页面
- C语言
- C语言实验——圆周率
- 个人总结39
- 开源代码应用之Eclipse篇
- 数列求和