Springboot工程Mybatis二级缓存配置
1、在application.yml配置cache-enabled: true
mybatis: config-location: classpath:/mybatis-config.xml, classpath:mybatis/mybatis-config.xml mapper-locations: classpath:mappers/*.xml,classpath:mybatis/mapper/*.xml configuration: cache-enabled: true
2、在xxxMapper.xml添加
a)<cache></cache> b) <select id="selectBygoodsCataCodeAndprovinceCode" resultMap="BaseResultMap" useCache="true" >
3)实体对象要implements Serializable,否则报错
public class CompleteTime implements Serializable
4、启动工程,如果出现
Cache Hit Ratio . #表示缓存开启了.....
相关推荐
dongxurr 2020-07-26
喝绿茶的猫 2020-06-12
xiuyangsong 2020-11-16
Nishinoshou 2020-11-09
jimgreatly 2020-09-01
dongxurr 2020-08-18
Dullonjiang 2020-08-15
Dullonjiang 2020-08-11
Dullonjiang 2020-08-09
dongxurr 2020-08-08
yunzhonmghe 2020-08-07
jimgreatly 2020-08-03
Dullonjiang 2020-07-30
jimgreatly 2020-07-27
liqiancao 2020-07-26
xiuyangsong 2020-07-26
mcvsyy 2020-07-26
helloxusir 2020-07-25