I was working with spring-ehcache-annotations and came across following scenario:
I have a simple POJO as follows
class Person{
private Long id;
private String name
//some code
}
Now in DAO I have
public Person getPerson(Long personId){}
public Person UpdatePerson(Person person){}
Now in update person I need parameter of class Person and I need to use personId of person as the key to cache.
This can be achieved by implmenenting CacheKeyGenerator for each class or putting blocks of if/else but can we have some configurable thing to give field of parameter to take as key ?
Can you switch to Spring 3.1 cache abstraction?
Your use case is then easily solvable by:
annotation.