public <T extends Object> T queryForObject(String querySql,RowMapper<T> rowMapper)
{
Assert.notNull(querySql,"query sql is must be not null");
Assert.notNull(rowMapper,"call-back interface RowMapper is must by not null");
logger.info("\n" + querySql);
return this.simpleJdbcTemplate.queryForObject(querySql,rowMapper,new Object[]
{});
}
public <T extends Object> T queryForObject(String querySql,Map<String,Object> queryParam,
RowMapper<T> rowMapper)
{
Assert.notNull(querySql,"query sql is must be not null");
Assert.notNull(rowMapper,"call-back interface RowMapper is must by not null");
if(Algorithms.isEmpty(queryParam))
{
queryForObject(querySql,rowMapper);
}
return this.simpleJdbcTemplate.queryForObject(querySql,rowMapper,queryParam);
}
public <T extends Object> T queryForObject(String querySql,List<Object> queryParam,
RowMapper<T> rowMapper)
{
return queryForObject(rowMapper,querySql,queryParam.toArray());
}
public <T extends Object> T queryForObject(RowMapper<T> rowMapper,String querySql,
Object ...queryParam)
{
Assert.notNull(querySql,"query sql is must be not null");
Assert.notNull(rowMapper,"call-back interface RowMapper is must by not null");
logger.info("\n" + querySql);
logger.info("\n" + queryParam.toString());
if(Algorithms.isEmpty(queryParam))
{
return queryForObject(querySql,rowMapper);
}
return this.simpleJdbcTemplate.queryForObject(querySql,rowMapper,queryParam);
}
浙公网安备 33010602011771号