Announcement Announcement Module
Collapse
No announcement yet.
How to add QueryHints on Default Spring Data JPA Methods? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to add QueryHints on Default Spring Data JPA Methods?

    I am able to use Query Cache with Spring Data JPA for my custom query methods like below.

    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); }
    However, how to add @QueryHints on existing parent methods like findAll()?

    Sorry for cross post from stackoverflow as I do not get any response there.

    Thanks.

  • #2
    cklee75, have you found working solution? Cause the post of stackoverflow doesn't clear the situation, @Cacheable seems not to work

    Comment

    Working...
    X