Dec 12th, 2011, 06:20 AM
@Cacheable using a static string
I'm using @Cacheable but to avoid conflicts, I need to use a unique identifier in the cache key. I would like to use a string but I keep getting errors on this such as:
EL1008Epos 14): Field or property 'x' cannot be found on object of type 'org.springframework.cache.interceptor.CacheExpres sionRootObject'
These are the expressions I'm trying to use
@Cacheable(value="products",key="'x' + #cat.id")
where x is a random String I chose.
Can anyone explain how to use "static identifiers" in a cacheable key?