【发布时间】:2016-10-04 11:13:22
【问题描述】:
我需要 3 个独立的缓存:
- 响应一些数据
- 空
- 异常
我已经定义了两个缓存
@Caching(cacheable = {
@Cacheable(value = "SomeCache", key = "#a1", unless = "#result == null"),
@Cacheable(value = "SomeNullCache", key = "#a1", unless = "#result != null")})
所以,我必须实现最后一种情况。
JSR-107 提供了带有 exceptionCacheName 属性的 @CacheResult 注释,但是我如何使用 Spring Cache 来做到这一点?我不想将 JSR-107 和 Spring Cache 结合起来。
【问题讨论】:
标签: java spring caching spring-cache jcache