今天犯了一个特low的问题。
报错具体日志如下
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 '**********Dao.get******Id'.
It's likely that neither a Result Type nor a Result Map was specified.
原因: 查询SQL返回的是JavaBean对象,而使用了parameterType属性(大low)
有兴趣的小伙伴可以自行百度一下resultType 与parameterType区别
另外:
问题解决期间,也怀疑是否为查询的字段与返回的对象类型字段名称不匹配,经过验证当查询SQL返回的字段与Javabean中的属性不符,即使查询出了结果但是程序返回的结果也为null