title: How to implement caching in Spring JPA
body: <p>I want to implement cache functionality in spring jpa repository using Ehcache with java configuration(not by xml). But am confused about the @cache, @caceevict,@cacheable, @caching annotations.</p>
  
  <p>1) I want to have data from cache, if data not available in cache then it should be fetch from database.</p>
  
  <p>2) from controller if I hit /api/cacheRefresh, it should refresh all the tables.</p>