首页 文章

@Cacheable注释的值和cacheName参数之间的差异

提问于
浏览
2

我是@Cacheable和@CacheEvict注释的新手,我们在Spring框架中用于缓存 . 但在研究@Cacheable使用 what is the difference between value and cacheName params of @Cacheable annotation 的实现和参数时?

1 回答

  • 1

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

    Value:

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

相关问题