我有一个问题与使用Spring 3查询返回的多个记录
我使用这个检索值返回多个值的查询,但TemplateFlow
对象返回从DB总是空(所有字段包含null
或默认值)。
List<TemplateFlow> flows = (List<TemplateFlow>) getJdbcTemplate().query(
sqlString,
ParameterizedBeanPropertyRowMapper.newInstance(TemplateFlow.class)
);
TemplateFlow
是一个包含所有字段的类。我在更新后检索一些值,是否有可能需要提交更改? (但我没有使用任何交易)。
public class TemplateFlow {
private int id_templateflow;
private int id_templateprocess;
public int id_templateflow() { return this.id_templateflow; }
public void id_templateflow(int id_templateflow) { this.id_templateflow = id_templateflow; }
public int id_templateprocess() { return this.id_templateprocess; }
public void id_templateprocess(int id_templateprocess) { this.id_templateprocess = id_templateprocess; }
}
我试图直接在数据库上运行查询它返回两行。
感谢您的帮助! 安德烈
当您在数据库的查询工具中使用您正在使用的参数运行查询时会发生什么? – lobster1234 2011-05-02 09:54:17