Mic*_*zak 4 spring spring-jdbc
Spring 3.0.5不推荐使用SimpleJdbcCall.returningResultSet(ParameterizedBeanPropertyRowMapper).如何更改我的代码以使用此方法的非弃用版本?
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));
}
Run Code Online (Sandbox Code Playgroud)
你应该能够使用BeanPropertyRowMapper而不是ParameterizedBeanPropertyRowMapper
new SimpleJdbcCall(jdbcTemplate)
.withCatalogName("package")
.withProcedureName("proc")
.returningResultSet("CURREPORTLIST",
BeanPropertyRowMapper.newInstance(Report.class));
Run Code Online (Sandbox Code Playgroud)
电话
BeanPropertyRowMapper.newInstance(Report.class));
Run Code Online (Sandbox Code Playgroud)
返回一个BeanPropertyRowMapper实现的实例RowMapper.将使用未弃用的版本returningResultSet.
| 归档时间: |
|
| 查看次数: |
2635 次 |
| 最近记录: |