redis注記方式------CAcheable
2249 ワード
@Service
public class cacheableServiceImpl implements cacheableService {
/**
* , key SimpleKey []
*
* : key , keyGenerator
*/
@Cacheable(cacheNames = "TestKeySpace")
@Override
public void methodOne() {
System.out.println("cha ");
}
/**
* , key toString
* : , paramA, key paramA
*
* : key , keyGenerator
*/
@Cacheable(cacheNames = "TestKeySpace")
@Override
public void methodTwo(String chen) {
System.out.println("cha ");
}
/**
* , key toString
* : , User , User toString key
*
* : key , keyGenerator
*/
@Cacheable(cacheNames = "TestKeySpace")
@Override
public User methodThree(User user) {
System.out.println("cha ");
return user;
}
@Cacheable(cacheNames = "TestKeySpace")
@Override
public void methodfour(Map