hibernate - How to add cache feature in Spring Data JPA CRUDRepository - Stack Overflow
I think basically @seven's answer is correct, but with 2 missing points:
We cannot define a generic interface, I'm afraid we have to declare every concrete interface separately since annotation cannot be inherited and we need to have different cache names for each repository.
saveanddeleteshould beCachePut, andfindAllshould be bothCacheableandCacheEvict
Read full article from hibernate - How to add cache feature in Spring Data JPA CRUDRepository - Stack Overflow
No comments:
Post a Comment