title: Use @Cacheable for non-argument method in Spring
body: <p>I'm using Spring cache API and was stuck with a problem:
  I have a Dao class with CRUD operations and all I want to do is to cache a no-argument method which returns me a Map of objects (Key - id, Value - entity)</p>
  
  <pre><code>class Dao implements IDao&lt;Entity&gt;{
  
      public Map&lt;Integer, Entity&gt; getAllEntities(){ /* retreiving from DB */ }
  
      public Entity getEntityByKey(Object key) { ... }
  
      public void insert(Entity entity){...}
  
      public void update(Entity entity){...}
  
      public void delete(Entity entity){...}
  
  }
  </code></pre>
  
  <p>Can anybody tell me how exactly (and correctly) can I cache getAllEntities() method to get entities, cache getEntityByKey to get Entity by key and also to be able to update cache when I perform create, update or delete operations ?
  And is it possible to use cacheable version of the method getAllEntities after update (using operations insert, update, delete) ?</p>