@CacheConfig(cacheManager = ACacheManager, cacheNames = ACache)
class A {
@Cacheable(key = "#user.userName", cacheManager="ACacheManager", cacheNames= {"ACache"})
methodA (User user) {
}
}
@CacheConfig(cacheManager = BCacheManager, cacheNames = BCache)
class B extends A {
@Cacheable(key = "#user.userName", cacheManager="BCacheManager", cacheNames= {"BCache"})
@Override
methodA (User user) {
}
}
A a = new A();
a.methodA();
结果应保存在ACacheManager的缓存ACache中
A b = new B();
b.methodA();
结果应保存在BCacheManager的缓存BCache中