xml里的配置:
<bean id="cacheManager" class="org.springframework.cache.guava.GuavaCacheManager" />
缓存内容:
@Cacheable(
value = "cfileCache",
key = "#id",
unless = "#result == null")
public CFile getCFile(int id) {
Object[] args = new Object[] {id};
List<CFile> list =
this.rJDBCTemplate.query(
"select * from cile c left join cde s on c.id=s.id where c.id=?",
args, new CFileRowMapper());
if (list.size() > 0) {
return list.get(0);
}
return null;
}
解决方案
40
题主能分享一下你的到的结论吗?你留的那个网址不在了