我讨论ibatis中的映射问题。返回的列表大小为3,但数据显示为空,因为数据库中包含数据。
List<RecordData> recordDataList = recordMapper.getQuestionDataParams(
personId, surveyId, questionIds);
System.out.println("rcord size" + recordDataList.size());
System.out.println("rcord size" + recordDataList);
此处大小为3,但数据为空。
<mapper namespace="com.workers.surveytoexcel.dao.IRecordMapper">
<resultMap id="surveyMap" type="com.workers.surveytoexcel.dom.RecordData" >
<result property="QUES_ID" column="quesId" />
</resultMap>
<select id="getQuestionDataParams" parameterType="map" resultMap="surveyMap">
select ques_id from t_survey_other_ans where doc_id=3294628 and ques_id=3743245
</select>
public class RecordData {
private long quesId;
/**
* @return the quesId
*/
public long getQuesId() {
return quesId;
}
/**
* @param quesId
* the quesId to set
*/
public void setQuesId(long quesId) {
this.quesId = quesId;
}
}
这里有什么问题?