首页 > 其他 > 详细

mybatis使用接口方式报错

时间:2017-06-07 19:36:42      阅读:318      评论:0      收藏:0      [点我收藏+]

报错:org.apache.ibatis.binding.BindingException: Type interface com.lmq.inter.MybatisBeanDao is not known to the MapperRegistry

原因:没有在xml文件中设置namesace和接口的全类名一致

MybatisBean.xml

<mapper namespace="com.lmq.inter.MybatisBeanDao">
<select id="selectMybatisTestByID" parameterType="int" resultType="MybatisBean">
select * from mybatistest where id = #{id}
</select>
</mapper>

 

则,对应的接口类必须是com.lmq.inter包下的MybatisBeanDao类,否则会出现上述错误

 

mybatis使用接口方式报错

原文:http://www.cnblogs.com/lmq-1048498039/p/6958554.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!