A query was run and no Result Maps were found for the Mapped Statement

Cause: org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'com.shadow.foretaste.UserInfoDao.getPhoneNum'.  It's likely that neither a Result Type nor a Result Map was specified.

導致這個錯誤的原因是:

mapper.xml中沒有指定返回值類型

<select id="getPhoneNum" >
        select phone_num from user_info where id = #{id}
</select>

修改後:

<select id="getPhoneNum" resultType="String">
        select phone_num  from user_info where id = #{id}
</select>


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章