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 . #表示缓存开启了.....

 

相关文章:

  • 2021-09-15
  • 2021-09-18
  • 2017-12-10
  • 2022-01-21
  • 2021-12-11
  • 2022-12-23
  • 2023-01-03
猜你喜欢
  • 2022-12-23
  • 2021-11-15
  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2017-12-11
相关资源
相似解决方案