很可能既沒有指定結果類型也沒有指定結果映射(標題不讓叫英文,所以我翻譯了下)

1.報錯問題

 

It's likely that neither a Result Type nor a Result Map was specified

2.錯誤原因:mybatis配置文件中沒有返回類型參數


    <select id="getList">
        select id,
        content,
        create_time,
        update_time
        from content
    </select>

3.解決辦法

添加resultType參數值


    <select id="getList" resultType="com.example.demo.service.content.vo.ContentVO">
        select id,
        content,
        create_time,
        update_time
        from content
    </select>

 

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