@Target(value=TYPE) @Retention(value=RUNTIME) @Documented @Import(value={CommonConfiguration.class,ConfigSelector.class}) public @interface EnableMethodCache
| 限定符和类型 | 必需的元素和说明 |
|---|---|
String[] |
basePackages |
| 限定符和类型 | 可选元素和说明 |
|---|---|
org.springframework.context.annotation.AdviceMode |
mode
Indicate how caching advice should be applied.
|
int |
order
Indicate the ordering of the execution of the caching advisor
when multiple advices are applied at a specific joinpoint.
|
boolean |
proxyTargetClass
Indicate whether subclass-based (CGLIB) proxies are to be created as opposed
to standard Java interface-based proxies.
|
public abstract String[] basePackages
public abstract boolean proxyTargetClass
false.
Applicable only if mode() is set to AdviceMode.PROXY.
Note that setting this attribute to true will affect all
Spring-managed beans requiring proxying, not just those marked with @Cacheable.
For example, other beans marked with Spring's @Transactional annotation will
be upgraded to subclass proxying at the same time. This approach has no negative
impact in practice unless one is explicitly expecting one type of proxy vs another,
e.g. in tests.
Copyright © 2013–2019. All rights reserved.