Method visibility and@Cacheable/@CachePut/@CacheEvict
When using proxies, you should apply the @Cache*annotations only to methods with public visibility.
If you do annotate protected, private or package-visible methods with these annotations, no error is raised, but the annotated method does not exhibit the configured caching settings. Consider the use of AspectJ (see below) if you need to annotate non-public methods as it changes the bytecode itself.
Ref : https://docs.spring.io/spring/docs/3.2.0.RC1/reference/html/cache.html
文章標籤
全站熱搜
留言列表