Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

0penJPA QueryCaching

 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am trying to cache the query results generated and later on use the results from the cache instead of touching the database.

This is what I am doing to put/get the values from the cache.





The thing I don't understand is how do I get the QueryKey (Referred to as key here in my code) ?

I tried doing this
but the q here in this line of code is supposed to be of type org.apache.openjpa.kernel.Query?


Can anybody help me with this please?

Thanks.
 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anybody?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic