【发布时间】:2014-09-24 02:26:32
【问题描述】:
多个表的数据必须映射到单个 bean。
在这种情况下,id,name 将从一个表中检索,optionList 从另一个表中检索。因此,来自 n 个表的数据应该与单个 bean 匹配。使用RowMapper or ResultSetExtractor or any alternative 的最佳方法是什么?之间的性能差异是什么
BeanPropertyRowMapper 和 RowMapper.
我的模型类是这样的:
class Preference{
int id;
int name;
List<Option> optionList; //will be retrieved from other table.
String contactName;
String ContactTitle;
}
【问题讨论】: