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

问题:

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'xxxxxxxxxxxxx'. It's likely that neither a Result Type nor a Result Map was specified.

 

解决方法:

需指定resultType或者resultMap。

举例:

在mapper.xml映射文件中,写了一个select

原来错误写法:

<select id="xxxx">

   select count(*) from xxx where id=#{id} and name=#{name}

</select>

修改后正确写法:

<select id="xxxx" resultType="java.lang.Integer">

    select count(*) from xxx where id=#{id} and name=#{name}

</select>

上一篇:解决已经安装好anaconda但【Ubuntu】conda: command not found解决办法


下一篇:成功解决 zsh: command not found