This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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!