我想試試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