jeudi 26 mars 2015

Is it possible to define more KeyGenerator classes for cache in Spring version 3.1.x?

I have a configuration class which implements CachingConfigurer to define a cache manager with a specific key generator, but I should use different key generators per caches.


There is an option form Spring 4.1 to specify a key generator per operation:



@Cacheable(cacheNames="cacheName1", keyGenerator="myKeyGenerator1")
@Cacheable(cacheNames="cacheName2", keyGenerator="myKeyGenerator2")


I'm wondering if there is any alternative for this in Spring 3.1?


Aucun commentaire:

Enregistrer un commentaire