@Cacheable 注解的 value 和 cacheName 参数的区别

Pra*_*nna 6 spring redis spring-data spring-data-jpa spring-boot

我是 @Cacheable 和 @CacheEvict 注释的新手,我们使用它们在 Spring 框架中进行缓存。但是,在查看 @Cacheable 使用@Cacheable 注释的 value 和 cacheName 参数之间的实现和参数时,有什么区别

jua*_*umn 7

通过查看Cacheable 文档, 值是cacheNames的别名,这意味着两者都绑定到同一个对象。

价值:

@AliasFor(value="cacheNames")
public abstract java.lang.String[] value
Alias for cacheNames().
Default:
{}
Run Code Online (Sandbox Code Playgroud)