【问题标题】:Difference between value and cacheName param of @Cacheable annotation@Cacheable注解的value和cacheName参数的区别
【发布时间】:2018-10-08 04:36:01
【问题描述】:

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

【问题讨论】:

    标签: spring spring-boot redis spring-data spring-data-jpa


    【解决方案1】:

    通过查看Cacheable documentation valuecacheNames 的别名,这意味着两者都绑定到同一个对象。

    价值:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-12
      相关资源
      最近更新 更多