Prasanna
Prasanna

Reputation: 131

Difference between value and cacheName param of @Cacheable annotation

I am new to @Cacheable and @CacheEvict annotations which we use for caching in Spring framework. But while looking into its implementation and parameters that @Cacheable uses what is the difference between value and cacheName params of @Cacheable annotation?

Upvotes: 7

Views: 5306

Answers (1)

juanlumn
juanlumn

Reputation: 7095

By taking a look into Cacheable documentation value is an Alias for cacheNames which means that both are tied to the same object.

Value:

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

Upvotes: 8

Related Questions