Register / Login
File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
Win a copy of
Clojure in Action
this week in the
Storing ranges in cache keys
posted 1 year ago
My db row has sample data as below
Example StoreId ProductId Eff_Date End_Date Discount 123 456 01-01-2001 12-31-2001 10% 123 456 01-01-2002 12-31-2002 15%
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:
Get Sum of column and the retrive the data month wise.
Conversion help plz!!!
Hibernate: one-to-one Different Composite Keys
How to calculate date in Java
Database to Hashmap