File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Caching » EhCache
Bookmark "Storing ranges in cache keys" Watch "Storing ranges in cache keys" New topic
Author

Storing ranges in cache keys

Mahi Gun
Greenhorn

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.


Thanks.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Storing ranges in cache keys
 
Similar Threads
Database to Hashmap
Conversion help plz!!!
Hibernate: one-to-one Different Composite Keys
How to calculate date in Java
Get Sum of column and the retrive the data month wise.