首页 > 编程知识 正文

cisco删除配置命令,ug移除参数如何恢复

时间:2023-05-03 17:36:09 阅读:17536 作者:827

@cacheable(「XXX”)时

对象获取XXX (stringa、String b、String c );

spring缓存中使用的key是ESPL表达式,查看源key时,缺省情况下在org.spring framework.cache.interceptor.simple key generator中生成

大于一个参数是最后的方法

/* * generateakeybasedonthespecifiedparameters.*/publicstaticobjectgeneratekey (object. params ) if ) params.lenen ame if(Param!=空! param.getClass ().isArray ) ) {return param; }returnnewsimplekey(Params ); }然后查看org.spring framework.cache.interceptor.simplekey对应的代码,可以看到实际上返回了simple key

/* * * create anew { @ linksimplekey } instance.* @ paramelementstheelementsofthekey */publicsimplekey (object . elemener ) 系统. arraycopy (elements,0,this.params,0,elements.length ); this.hashcode=arrays.deep hashcode (this.params ); 解决想法:

场景1 :编写自定义的密钥生成器并处理相应的密钥。 (上一篇redis的文章已经写好了,所以不重复写)

下面的名为MyKeyGenerator的类

sprintboot使用spring-security包,缓存内存与redis共存

方案2@cacheable(value=「XXX”、key=“xxxx”) ) ) ) ) ) ) ) )。

@cacheevict(value=“XXX”、key=“xxxx”) )

进行适当的key配置

如果是数组,则可以使用key=“#root.args[0]”

参数如下:

名称位置说明示例methodNameroot object当前调用的方法名称#root.methodnamemethodrootobject当前调用的方法# root.method.nametargetrootobject root.targettargetclassrootobject当前调用的目标对象类# root.targetclassargsrootobject当前调用的方法的参数列表# root.arroot cachesroot object当前调用的方法所使用的. nameargumentnameevaluationcontext方法参数的名称可以直接使用#参数名,也可以使用#iban、#a0、# P0 rrram

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。