MyBatis 使用报错:
org.apache.ibatis.binding.BindingException: Type interface com.ntt.dao.UserMapper is not known to the MapperRegistry.
解决:XxxMappper.xml
文件中的namespace
属性和对应的接口地址不一致,修改正确的接口地址 namespace = " com.ntt.dao.XxxMapper "
映射的作用:一个映射文件就对应一个接口,一个接口可以有多个映射文件,一般是一对一关系。
mapper
标签的namespace
属性的作用:关联接口,需要配置对应接口的类全名字符串