@Retention(value=RUNTIME) @Documented @Target(value=METHOD) public @interface Cache
| 限定符和类型 | 可选元素和说明 |
|---|---|
String[] |
cacheNames
缓存 cache 名称,默认:[前缀:]类名:方法名
|
long |
expires
生存时间
|
String |
key
缓存 key 支持SpringEL表达式
如果为空,则使用
keyGenerator()生成 |
Class<? extends SpringKeyGenerator> |
keyGenerator
key生成器,当key为空时生效
|
String |
prefix
cacheName前缀,可使用全局变量“spring.cache.prefix”统一配置
|
TimeUnit |
timeUnit
生存时间单位,默认毫秒
|
long |
value
生存时间
|
public abstract TimeUnit timeUnit
public abstract String prefix
public abstract String[] cacheNames
public abstract String key
keyGenerator()生成public abstract Class<? extends SpringKeyGenerator> keyGenerator
Copyright © 2022 Pivotal Software, Inc.. All rights reserved.