I am able to use Query Cache with Spring Data JPA for my custom query methods like below.
However, how to add @QueryHints on existing parent methods like findAll()?Code:public interface CountryRepository extends JpaRepository<Country, String> { @QueryHints({ @QueryHint(name = "org.hibernate.cacheable", value ="true") }) Country findByCountryName(String countryName); @QueryHints({ @QueryHint(name = "org.hibernate.cacheable", value ="true") }) Country findByCountryCode(String countryCode); }
Sorry for cross post from stackoverflow as I do not get any response there.
Thanks.


Reply With Quote
