update 关闭默认二级缓存 推荐使用 spring-cache 注解手动缓存
This commit is contained in:
parent
c26073afeb
commit
de194880ae
|
@ -158,7 +158,7 @@ mybatis-plus:
|
||||||
# STATEMENT 关闭一级缓存
|
# STATEMENT 关闭一级缓存
|
||||||
localCacheScope: SESSION
|
localCacheScope: SESSION
|
||||||
# 开启Mybatis二级缓存,默认为 true
|
# 开启Mybatis二级缓存,默认为 true
|
||||||
cacheEnabled: true
|
cacheEnabled: false
|
||||||
# 更详细的日志输出 会有性能损耗
|
# 更详细的日志输出 会有性能损耗
|
||||||
# logImpl: org.apache.ibatis.logging.stdout.StdOutImpl
|
# logImpl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
global-config:
|
global-config:
|
||||||
|
|
|
@ -15,6 +15,9 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||||
/**
|
/**
|
||||||
* mybatis-redis 二级缓存
|
* mybatis-redis 二级缓存
|
||||||
*
|
*
|
||||||
|
* 使用方法 配置文件开启 mybatis-plus 二级缓存
|
||||||
|
* 在 XxxMapper.java 类上添加注解 @CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class)
|
||||||
|
*
|
||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
|
@ -11,8 +11,6 @@ import org.apache.ibatis.annotations.CacheNamespace;
|
||||||
* @author ${author}
|
* @author ${author}
|
||||||
* @date ${datetime}
|
* @date ${datetime}
|
||||||
*/
|
*/
|
||||||
// 如使需切换数据源 请勿使用缓存 会造成数据不一致现象
|
|
||||||
@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class)
|
|
||||||
public interface ${ClassName}Mapper extends BaseMapperPlus<${ClassName}> {
|
public interface ${ClassName}Mapper extends BaseMapperPlus<${ClassName}> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue