title: Add a Constant Custom Prefix to Cache key when using Spring Caching Annotations
body: <p>I am using Spring Cache abstraction based on annotations in my service.</p>
  
  <p>I want to add a custom prefix to the key when added to the cache.</p>
  
  <p>I created a constant and tried to add them to the methods as below.</p>
  
  <pre><code>private static final String CACHE_KEY_PREFIX="user";
  
      @Cacheable(value = "users", key = "{ CACHE_KEY_PREFIX,#userId }")
      @GetMapping("/{userId}")
      public User getUser(@PathVariable String userId) {
          LOG.info("Getting user with ID {}.", userId);
          return userRepository.findOne(Long.valueOf(userId));
      }
  
  
      @CacheEvict(value = "users",key="{ CACHE_KEY_PREFIX,#userId }" )
      @DeleteMapping
      public void deleteUserByID(@PathVariable Long userId) {
          LOG.info("deleting person with id {}", userId);
          userRepository.delete(userId);
      }   
  </code></pre>
  
  <p>But, I get the stacktrace as below.</p>
  
  <pre><code>2018-06-12 13:35:48.911 ERROR 8728 ---  [nio-8090-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]     Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.expression.spel.SpelParseException: EL1041E: After parsing a valid expression, there is still more data in the expression: 'hash(#)'] with root cause
  
  org.springframework.expression.spel.SpelParseException: EL1041E: After parsing a valid expression, there is still more data in the expression: 'hash(#)'
      at org.springframework.expression.spel.standard.InternalSpelExpressionParser.doParseExpression(InternalSpelExpressionParser.java:129)
      at org.springframework.expression.spel.standard.SpelExpressionParser.doParseExpression(SpelExpressionParser.java:60)
  </code></pre>
  
  <p>Since I have multiple methods I do not want to hardcode the custom prefix in every method annotation.</p>
  
  <p>Is there a way to add a custom prefix and avoid the exception I am seeing.</p>