spring boot + MyBatis 注解实现 二级缓存

在application.yml 中新加

mybatis:
    configuration:
      cache-enabled: true

dao层类上面添加注解

@CacheNamespace(size = 512)

在实体类,(也就是JaveBean)实现一个系列化接口

public class Person implements Serializable{
    //内容省略
}

猜你喜欢

转载自blog.csdn.net/qq_18115729/article/details/79283043