Spring Cache with collection of items/entities : <p>I am using Spring Cache, where I pass in a collection of keys, and the return is a list of entities. I would like to have the caching framework understand that each element in the return list is to be cached with the corresponding code. At the moment, it seems that the key is the whole list, and if I am missing a key in the subsequent call, it'll try to reload the whole collection again. </p>

<pre><code>@Override
@Cacheable(value = "countries")
public List&lt;Country&gt; getAll(List&lt;String&gt;codes) {
    return countryDao.findAllInCodes(codes);
}
</code></pre>

<p>another possibility is that the return is a map, similarly I would like the cache to be intelligent enough to only query for items that were never queried before, also to cache them each item with its key. </p>

<pre><code>@Override
@Cacheable(value = "countries")
public Map&lt;String,Country&gt; getAllByCode(List&lt;String&gt;codes) {
    return countryDao.findAllInCodes(codes);
}
</code></pre>

<p>Suppose the country class looks like this: </p>

<pre><code>class Country{
  String code; 
  String fullName;
  long id;

... // getters setters constructurs etc.. 
}
</code></pre>

<p>Is this possible with Spring Cache?</p>
