-
Aug 18th, 2011, 10:28 AM
#1
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
-
Aug 18th, 2011, 11:16 AM
#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();
-
Aug 23rd, 2011, 01:26 AM
#3
Currently the CRUD methods cannot be equipped with @QueryHints. Feel free to open a JIRA if you like to see that supported.
-
Aug 23rd, 2011, 07:28 AM
#4
Query Caching
Thanks Oliver, I will raise a JIRA
What's the easiest way to get involved in Developing Spring Data?
Thanks
Mappy
-
Feb 14th, 2012, 01:16 AM
#5
Oliver:
Are @QueryHint on CRUD methods supported in JPA 1.0.2?
thanks
*K
-
Feb 14th, 2012, 01:26 AM
#6
Nope, no ticket implies no relevance implies no fix
. But feel free to create one if it matters to you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules