Does anybody know how the default key generation for Ehcache works? If I have the following method:
@Cacheable(cacheName = CACHE_KEY) // CACHE_KEY is static final field.
public List<DataObject> list(
int firstRecord, int maxRecords, int pageSize, FilterObject filter) {
....
}
where FilterObject
is a custom POJO, what should I expect to be the actual cache key?
What I am observing is when using different FilterObject
instances and not changing the other arguments of my method call, it always produces the same result - the first call's result is cached and returned.
Probably it is the FilterObject
POJO which causes the behaviour - I suppose it is either some serialization, or .toString()
issue, because I haven't overridden the relevant methods.
Still I was unable to find exact information on how the cache key for such method is being formed both in Ehcache's website and in the @Cacheable
annotation documentation.
I'd appreciate any information and recommendations on this topic.