【发布时间】:2018-10-08 04:36:01
【问题描述】:
我是 @Cacheable 和 @CacheEvict 注释的新手,我们在 Spring 框架中用于缓存。但是在查看 @Cacheable 使用的实现和参数时@Cacheable 注释的 value 和 cacheName 参数有什么区别?
【问题讨论】:
标签: spring spring-boot redis spring-data spring-data-jpa
我是 @Cacheable 和 @CacheEvict 注释的新手,我们在 Spring 框架中用于缓存。但是在查看 @Cacheable 使用的实现和参数时@Cacheable 注释的 value 和 cacheName 参数有什么区别?
【问题讨论】:
标签: spring spring-boot redis spring-data spring-data-jpa
通过查看Cacheable documentation value 是 cacheNames 的别名,这意味着两者都绑定到同一个对象。
价值:
@AliasFor(value="cacheNames")
public abstract java.lang.String[] value
Alias for cacheNames().
Default:
{}
【讨论】: