注释类型 CacheConfig
@Target(TYPE) @Retention(RUNTIME) @Documented public @interface CacheConfig
@CacheConfig
provides a mechanism for sharing common cache-related settings at the class level.When this annotation is present on a given class, it provides a set of default settings for any cache operation defined in that class.
- 从以下版本开始:
- 4.1
- 作者:
- Stephane Nicoll, Sam Brannen
可选元素概要
可选元素 修饰符和类型 可选元素 说明 String
cacheManager
The bean name of the customCacheManager
to use to create a defaultCacheResolver
if none is set already.String[]
cacheNames
Names of the default caches to consider for caching operations defined in the annotated class.String
cacheResolver
The bean name of the customCacheResolver
to use.String
keyGenerator
The bean name of the defaultKeyGenerator
to use for the class.
元素详细资料
cacheNames
String[] cacheNames
Names of the default caches to consider for caching operations defined in the annotated class.If none is set at the operation level, these are used instead of the default.
May be used to determine the target cache (or caches), matching the qualifier value or the bean names of a specific bean definition.
- 默认值:
- {}
keyGenerator
String keyGenerator
The bean name of the defaultKeyGenerator
to use for the class.If none is set at the operation level, this one is used instead of the default.
The key generator is mutually exclusive with the use of a custom key. When such key is defined for the operation, the value of this key generator is ignored.
- 默认值:
- ""
cacheManager
String cacheManager
The bean name of the customCacheManager
to use to create a defaultCacheResolver
if none is set already.If no resolver and no cache manager are set at the operation level, and no cache resolver is set via
cacheResolver()
, this one is used instead of the default.- 另请参阅:
SimpleCacheResolver
- 默认值:
- ""
cacheResolver
String cacheResolver
The bean name of the customCacheResolver
to use.If no resolver and no cache manager are set at the operation level, this one is used instead of the default.
- 默认值:
- ""