在Spring缓存注解中的key属性中使用SpEL表达式
| 名字 | 位置 | 描述 | 示例 | 
|---|---|---|---|
| methodName | root object | 当前被调用的方法名 | #root.methodName | 
| method | root object | 当前被调用的方法 | #root.method .name | 
| target | root object | 当前被调用的目标对象 | #root.method .name | 
| targetClass | root object | 当前被调用的目标对象类 | #root.target | 
| args | root object | 当前被调用的方法的参数列表 | #root.targetClass | 
| caches | object | 当前方法调用使用的缓存列表 | #root.args[0] | 
| argument name | evaluation context | 方法参数的名字,可以直接#参数名,也可以使用#p0或#a0的形式,0代表参数的索引 | #iban、#a0、#p0 | 
| result | evaluation context | 方法执行后的返回值 | #result | 
    If you’re going to reuse code, you need to understand that code!

 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号