Announcement Announcement Module
Collapse
No announcement yet.
Query Caching Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Query Caching

    Is query caching possible with Spring Data JPA



    @Query("select p from Person p order by personNumber ASC")
    List<Branch> findAllPersonsOrderByPersonNumberAsc();


    - can I apply some form of query cache - hibernate/echache to this ?

    Thanks
    Mappy

  • #2
    More detail for Query Caching

    So I'd like to cache the results from findAll and findOne, but it seems to ignore the cache

    @Query("from People")
    @QueryHints({ @QueryHint(name = "org.hibernate.cacheable", value ="true") })
    List<People> findAll();


    However If I change the method name it works, Id rather not have 2 methods findAll and findAllCached


    @Query("from People")
    @QueryHints({ @QueryHint(name = "org.hibernate.cacheable", value ="true") })
    List<People> findAllCached();

    Comment


    • #3
      Currently the CRUD methods cannot be equipped with @QueryHints. Feel free to open a JIRA if you like to see that supported.

      Comment


      • #4
        Query Caching

        Thanks Oliver, I will raise a JIRA
        What's the easiest way to get involved in Developing Spring Data?


        Thanks
        Mappy

        Comment


        • #5
          Oliver:
          Are @QueryHint on CRUD methods supported in JPA 1.0.2?
          thanks
          *K

          Comment


          • #6
            Nope, no ticket implies no relevance implies no fix . But feel free to create one if it matters to you.

            Comment


            • #7
              Oliver, the same question: is any support of caching basic CRUD methods in current JPA Data Release? Thanks a lot

              Comment


              • #8
                Caching seems like a pretty standard feature here, really, no way to use @Cacheable or @Cache?

                Comment

                Working...
                X