您好,欢迎来到保捱科技网。
搜索
您的当前位置:首页mybatis使用接口方式报错

mybatis使用接口方式报错

来源:保捱科技网

报错: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类,否则会出现上述错误

 

转载于:https://www.cnblogs.com/lmq-1048498039/p/6958554.html

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- baoaiwan.cn 版权所有 赣ICP备2024042794号-3

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务