新发现spring jdbc 2.5中有个BeanPropertyRowMapper,原来可以简单点,做记录和对象的映射,但前提
是你的POJO的属性跟记录集的声明是一样的,有点象APACHE的beanutils:
public List<Customer> getAll() {
return getJdbcTemplate().query("select * from test", new BeanPropertyRowMapper(Test.class));
}
Copyright @ 2024 jackyrong的世界 Powered by .NET 9.0 on Kubernetes Powered by: .Text and ASP.NET Theme by: .NET Monster