Mybatis报错: A query was run and no Result Maps were found for the Mapped Statemen

28 阅读1分钟

Mybatis报错: A query was run and no Result Maps were found for the Mapped Statement

完整报错如下:
A query was run and no Result Maps were found for the Mapped Statement ‘com.mapper.CarMapper.CarORM’. It’s likely that neither a Result Type nor a Result Map was specified.
这是我的一个报错信息,我们来看最后一句It’s likely that neither a Result Type nor a Result Map was specified.(很可能既没有指定结果类型,也没有指定结果映射。) 这个是我在做 orm 配置 做<select id="方法名字" parameterType="参数类型(可忽略)" resultType="返回类型"></select>
遗漏了里面一个属性resultType="返回类型" 或者 resultMap=""
mybatis中的所有查询标签,都必须返回resultType或者resultMap的值,否则就会报如上错误的,其实仔细看看因为报错原因的意思就好了 。