我想试试Spring 3.1 Cache Abstraction,用@Cachable注解一些方法。这对没有参数的方法来说工作得很好。对于带有参数的方法,它不会。在文档中找不到任何内容(http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/cache.html)。Spring @Cachable:不能使用参数方法
任何人遇到同样的事情?
方法调用:
@Cachable("countries")
public List<ConfigEntity> findCountries(Locale locale) {
ConfigSearchDescription desc = new ConfigSearchDescription();
// ...
return findConfigs(desc);
}
感谢 强尼
它工作得很好,证明你的代码,请 – 2011-12-19 09:28:48
感谢您的快速反应。它直接转到了文档的示例代码。方法调用: ' @Cachable( “国家”) 公开名单 findCountries(区域设置区域) { \t ConfigSearchDescription DESC =新ConfigSearchDescription(); \t // ... return findConfigs(desc); } ' –
user871611
2011-12-19 09:41:30
对不起,格式化。 – user871611 2011-12-19 09:42:05