@CacheNamespace(readWrite = false)
public interface MyMapper {
@Select("select * from student")
@Options(useCache = false)
List<Student> getAllStudent();
使用@CacheNamespace
注解直接定义在接口上即可,然后我们可以通过使用@Options
来控制单个操作的缓存启用。
@CacheNamespace(readWrite = false)
public interface MyMapper {
@Select("select * from student")
@Options(useCache = false)
List<Student> getAllStudent();
使用@CacheNamespace
注解直接定义在接口上即可,然后我们可以通过使用@Options
来控制单个操作的缓存启用。