很可能既没有指定结果类型也没有指定结果映射(标题不让叫英文,所以我翻译了下)

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>

 

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