使用多个键@Caching
我有一个服务,它接受DTO并返回一些结果:
@Override
public int foo(Bar bar) {
....
}
条形图如下(简体):
public class Bar {
public int id;
public String name;
public String baz;
@Override
public int hashCode() {
//this is already being defined for something else
...
}
@Override
public boolean equals(Object o) {
//this is already being defined for something else
...
}
}
我想在foo方法上使用@Cacheable;但是,我想对id和name属性进行哈希处理,但不是baz。有没有办法做到这一点?