This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets 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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Storing ranges in cache keys
 
Similar Threads
Conversion help plz!!!
Hibernate: one-to-one Different Composite Keys
Database to Hashmap
How to calculate date in Java
Get Sum of column and the retrive the data month wise.