Announcement Announcement Module
Collapse
No announcement yet.
@Cacheable using a static string Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @Cacheable using a static string

    Hi,

    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?

    Kind regards,
    Marc
Working...
X