1 Star 0 Fork 248

淼哥不坏 / AutoLoadCache

forked from qiujiayu / AutoLoadCache 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
CacheDeleteTransactional.java 927 Bytes
一键复制 编辑 原始数据 按行查看 历史
qiujiayu 提交于 2020-03-09 23:33 . remove @author 
package com.jarvis.cache.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 事务环境中批量删除缓存注解<br>
* 注意:此注解放到service层,并且需要开启事务的方法上, 用于收集@CacheDeleteKey生成的Key,并在最后进行删除缓存。
*
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Inherited
@Documented
public @interface CacheDeleteTransactional {
/**
* 在事务环境中是否使用缓存数据,默认为false
*
* @return true or false
*/
boolean useCache() default false;
/**
* 当发生异常时,还删除缓存
*
* @return true or false
*/
boolean deleteCacheOnError() default true;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/xugm/AutoLoadCache.git
git@gitee.com:xugm/AutoLoadCache.git
xugm
AutoLoadCache
AutoLoadCache
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891