File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EhCache and the fly likes Storing ranges in cache keys Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Caching » EhCache
Bookmark "Storing ranges in cache keys" Watch "Storing ranges in cache keys" New topic

Storing ranges in cache keys

Mahi Gun

Joined: Feb 19, 2014
Posts: 1
Hi all,

My db row has sample data as below

When a customer comes in, my code checks discount something like
select discount from table where storeId='123' and productId='456' and current_date<= EndDate and current_date>=Eff_date.

This works absolutely fine.

We need to store above data in cache. How can we store these date ranges in cache keys so that when customer purchases an item, we hit the right cache Key-value pair.

I agree. Here's the link:
subject: Storing ranges in cache keys
It's not a secret anymore!