使用 MyBatis 的 mapper 接口调用时有哪些要求?

1、Mapper 接口方法名和 mapper.xml 中定义的每个 sql 的 id 相同;

2、Mapper 接口方法的输入参数类型和 mapper.xml 中定义的每个 sql 的

parameterType 的类型相同;

3、Mapper 接口方法的输出参数类型和 mapper.xml 中定义的每个 sql 的

resultType 的类型相同;

4、Mapper.xml 文件中的 namespace 即是 mapper 接口的类路径。

原文地址:https://www.cnblogs.com/programb/p/12687050.html