本文共 592 字,大约阅读时间需要 1 分钟。
Dao代码如下:
@Repository
@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) }
}
未完,周末再写
转载于:https://blog.51cto.com/8953871/2126063