I have two methods as below .One is annotated with @CachePut and another is annotated with @Cacheable.Both of them uses the same key . Based on some of the answers from other posts I figured that @cacheput replaces the value. If that is the case , would the method annotated with @Cacheable be executed for the same id if there is an update to one of the fields in document.
@CachePut(value="testcache",key="#document.id")
public Document update(Document document){
// code to update db
return document
}
@Cacheable(value="testcache")
public Document getDocument(String id){
// query database and fetch document
return document
}