在我的应用中,我必须像这样拖曳缓存:
@Cacheable(cacheNames = "user", key= "#userId")
public User queryUserDetail(Long userId) {
......
}
@Cacheable(cacheNames = "address", key= "#addressId")
public Address queryAddressDetail(Long addressId) {
......
}
如果cacheNames是“ user”,我想清除所有缓存:
@CacheEvict(cacheNames = "user", allEntries = true)
public void clearAllUserCache() {}
但它也清除了带有cacheNames“ address”的缓存,
我该如何使用cacheNames“ user”清除缓存