Annotation Type CachePut


@Retention(CLASS) @Target(METHOD) public @interface CachePut

Always runs the method, then keeps what it returned under its key, so a later Cacheable call of the same key is answered with it -- Spring's @CachePut.

Keys, names and lifetimes are as Cacheable describes. A null result removes the entry, so the cache never answers with a value the method no longer gives.

  • Element Details

    • value

      String[] value
      The cache's name; the first is used when several are given.
      Default:
      {}
    • cacheNames

      String[] cacheNames
      The same as value(), as Spring spells it.
      Default:
      {}
    • key

      String key
      The key expression; see Cacheable.
      Default:
      ""
    • unless

      String unless
      Accepted when it is #result == null; see Cacheable.unless().
      Default:
      ""