15.2.3.3.2. Cache Keys for Cached Results
As a default, the
@CacheResult
annotation creates a key for the results fetched from a cache. The key consists of a combination of all parameters in the relevant method.
Create a custom key using the
@CacheKey
annotation as follows:
@CacheResult public void doSomething (@CacheKey String p1, @CacheKey String p2, String dontCare) { ... }
In the specified example, only the values of
p1
and p2
are used to create the cache key. The value of dontCare
is not used when determining the cache key.