我有两种方法来获取具有两个不同参数的实体.我还有一个使用其中一个参数的保存方法.如何在两个提取键下从缓存中逐出实体?例如见下文:
@Cacheable
public User getByUsername(String username);
@Cacheable
public User getByEmail(String email);
@CacheEvict(key="#entity.username")
User save(User entity);
Run Code Online (Sandbox Code Playgroud)
在上面,对getByEmail的调用将返回过时日期.