Scenario: I have a product table with a primary key of product ID. I have set up hibernate with a secondary cache (ehcache) with a read-only strategy and query caching has been enabled.
I have a request to start using Oracle's flashback features
Question:
What I would like to know is that, if the product table is archived (using the flashback features) and I am going to use a SQL query as follows, how will that impact the query caching set up in hibernate? Will Hibernate recognise AS OF
and take the timestamp into account while caching and serving the product entity when queried?:
SELECT * FROM product
AS OF TIMESTAMP
TO_TIMESTAMP('2004-04-04 09:30:00', 'YYYY-MM-DD HH:MI:SS')
WHERE productId = '1-XXXX'
The question basically is, does Hibernate cache based purely on the WHERE
clause or does it take the entire query into account when it checks the cache?