spring管理的ehcache緩存沒有起做用的原因
阿新 • • 發佈:2018-06-07
scala ehcache Dao代碼如下:
@Repository@EnableCaching
br/>@EnableCaching
@Cacheable(keyGenerator = "cacheKeyGenerator", cacheNames = Array("merInfo"))
private def findByName(name: String): Option[User] = {
val sql = "" //此處為sql val rs = jdbcTemplate.queryForRowSet(sql, name) if (rs.next()) { Some(User( rs.getString("name"), rs.getString("age") )) } else None } def findUser(name: String): Option[User] = { findByName(name) }
}
spring管理的ehcache緩存沒有起做用的原因