October 2017
Intermediate to advanced
396 pages
10h 2m
English
Spring's cache abstraction allows you to use multiple annotations of the same type for caching a method by using the @Caching annotation in a Spring application. The @Caching annotation groups other annotations such as @Cacheable, @CachePut, and @CacheEvict for the same method. For example:
@Caching(evict = {
@CacheEvict("accountCache "),
@CacheEvict(value="account-list", key="#account.accountId") })
public List<Account> findAllAccount(){
return (List<Account>) accountRepository.findAll();
}
Read now
Unlock full access