Mapper method ‘com.dao.xxxx‘ has an unsupported return type

阅读 52

2022-02-08

出现此异常是因为返回的数据类型不对应
错误示范

dao层代码片

public List<student> insertgradesex(student stu);

对应的Mapper代码片

<select id="insertgradesex">
        select * from
            stuinfo
            where 1=1
            <if test="sex!=null and sex!=''">
                and sex = #{sex}
            </if>
            <if test="grade!=null and grade!=''">
                and grade = #{grade}
            </if>
    </select>

更正

 <select id="insertgradesex" parameterType="student" resultType="student">
        select * from
            stuinfo
            where 1=1
            <if test="sex!=null and sex!=''">
                and sex = #{sex}
            </if>
            <if test="grade!=null and grade!=''">
                and grade = #{grade}
            </if>
    </select>

异常解决

精彩评论(0)

0 0 举报