从已弃用的spring转换
Spring 3.0.5不推荐使用SimpleJDBCall.returningResultSet(ParameterizedBeanPropertyRowMapper)。如何更改我的代码以使用此方法的未弃用版本从已弃用的spring转换,spring,spring-jdbc,Spring,Spring Jdbc,Spring 3.0.5不推荐使用SimpleJDBCall.returningResultSet(ParameterizedBeanPropertyRowMapper)。如何更改我的代码以使用此方法的未弃用版本 private JdbcTemplate jdbcTemplate; private SimpleJdbcCall procGetReportExtras; public void setDataSource(DataSource dataSource) { this.jd
private JdbcTemplate jdbcTemplate;
private SimpleJdbcCall procGetReportExtras;
public void setDataSource(DataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
jdbcTemplate.setResultsMapCaseInsensitive(true);
this.procGetReportExtras =
new SimpleJdbcCall(jdbcTemplate)
.withCatalogName("package")
.withProcedureName("proc")
.returningResultSet("CURREPORTLIST",
ParameterizedBeanPropertyRowMapper.newInstance(Report.class));
}
您应该能够使用
BeanPropertyRowMapper
而不是参数化BeanPropertyRowMapper
new SimpleJdbcCall(jdbcTemplate)
.withCatalogName("package")
.withProcedureName("proc")
.returningResultSet("CURREPORTLIST",
BeanPropertyRowMapper.newInstance(Report.class));
电话
BeanPropertyRowMapper.newInstance(Report.class));
返回实现
行映射器的BeanPropertyRowMapper
实例。将使用未弃用版本的returningResultSet
。非常有效。谢谢@MichaelSobczak不客气。如果它涵盖了一切,就考虑接受答案。