CacheResult, CachePut,
CacheRemove, and CacheRemoveAll at the class level. Without
the method level annotations this annotation has no effect.
Following is an example of specifying a default cache name that is used by the annotations on the getDomain and deleteDomain methods. The annotation for getAllDomains would use the "allDomains" cache name specified in the method level annotation.
package my.app;
@CacheDefaults(cacheName="domainCache")
public class DomainDao {
@CacheResult
public Domain getDomain(String domainId, int index) {
...
}
@CacheRemove
public void deleteDomain(String domainId, int index) {
...
}
@CacheResult(cacheName="allDomains")
public List<Domain> getAllDomains() {
...
}
}
| Modifier and Type | Method and Description |
|---|---|
| public Class | cacheKeyGenerator()
The |
| public String | cacheName()
The default name of the cache for the annotated class If not specified defaults to: package.name.ClassName.methodName(package.ParameterType,package.ParameterType)
Applicable for |
| public Class |
| cacheKeyGenerator | back to summary |
|---|---|
| public Class The
Defaults to a key generator that uses CacheResult, CachePut, and CacheRemove
| |
| cacheName | back to summary |
|---|---|
| public String cacheName() The default name of the cache for the annotated class If not specified defaults to: package.name.ClassName.methodName(package.ParameterType,package.ParameterType)
Applicable for
| |
| cacheResolverFactory | back to summary |
|---|---|
| public Class The
The default resolver pair will resolve the cache by name from the default
Applicable for
| |