Created
January 3, 2014 12:32
cachingdemo PricingServiceImpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.pelssers.services; | |
import java.util.List; | |
import org.springframework.cache.annotation.Cacheable; | |
import com.google.common.collect.Lists; | |
public class PricingServiceImpl implements PricingService { | |
@Cacheable(value = "services.pricing", key = "#productId") | |
public List<Integer> getPriceHistory(Long productId) { | |
System.out.println("Fetching prices from DB"); | |
return Lists.newArrayList(2, 6, 8, 5, 9); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment