How to check for null for a key in@Cacheable?

30 views Asked by At

Is there a way to check if marketCoverage is null before calling market.getValue() in statement mentioned below ?

@Cacheable(value = "issuerCache",key="#zip + #county + #marketCoverage.getValue + T(com.hcentive.utils.PlanYearContextHolder).getPlanYear()")
@Cacheable(value = "issuerCache",key="#zip + #county + #marketCoverage!=null?marketCoverage.getValue:null + T(com.hcentive.utils.PlanYearContextHolder).getPlanYear()")

tried this but it seems to not work.

0

There are 0 answers