Jul 11th, 2012, 02:34 AM
How can one enable caching on entities when using Spring Data JPA?
We are using Spring Data JPA on our project (quite successfully). We want to enable caching for certain entities. In some cases the entity instances will be cached eternally (in terms of JVM process lifetime) while in other cases the caching will be time-bound.
Are there any examples and documentation on enabling distributed caching when using Spring Data JPA? I know how to do this with plain-vanilla Hibernate and different types of caches such as EHCACHE, Tangosol, etc. but could not find any documentation on doing this with Spring Data JPA.
Jul 11th, 2012, 05:51 AM
Just use the Cache-Annotations of Spring or JPA 2.0.
Spring JPA Data has no special cache handling.