How to cahce only by single parameter in the method argument

27 views
Skip to first unread message

vijaykr...@gmail.com

unread,
Mar 13, 2013, 10:40:23 PM3/13/13
to ehcache-sprin...@googlegroups.com
    public List<CoverageAgreement> retrieveCoveragesByPlanId( Integer planId, DateTime dateFrom, DateTime dateTo)  --> In this method i want to cache the return type only based on the PLAN ID argument. Is there any way i can do that.
I did the below and its not working. Can any one please help.

@Cacheable(cacheName = "contractByPlanIdCache", keyGenerator = @KeyGenerator(name = "StringCacheKeyGenerator"))
    public List<CoverageAgreement> retrieveCoveragesByPlanId(@PartialCacheKey Integer planId, DateTime dateFrom, DateTime dateTo) {

Reply all
Reply to author
Forward
0 new messages