新发现spring jdbc 2.5中有个BeanPropertyRowMapper,原来可以简单点,做记录和对象的映射,但前提

是你的POJO的属性跟记录集的声明是一样的,有点象APACHE的beanutils:

 

 

  public List<Customer> getAll() {   

     return getJdbcTemplate().query("select * from test"new BeanPropertyRowMapper(Test.class));   

  }  

 

相关文章:

  • 2021-08-02
  • 2022-12-23
  • 2021-05-02
  • 2021-11-11
  • 2021-09-20
  • 2021-04-02
  • 2022-12-23
  • 2021-08-28
猜你喜欢
  • 2021-11-22
  • 2022-12-23
  • 2021-09-15
  • 2022-12-23
  • 2021-07-05
  • 2022-12-23
相关资源
相似解决方案