1、mybatis 跟spring 整合的入口在哪?
查看类:MapperScannerConfigurer 和 SqlSessionFactoryBean
2、mybatis 使用接口Mapper,如何将Mapper 实例化成spring bean?
查看 MapperFactoryBean -> MapperProxyFactory -> MapperProxy
3、Mapper 接口默认的select、insert 方法实现是在哪?
查看 MapperProxy.invoke() -> MapperMethod.execute()
4、mybatis 何时将 mappedStatement (即xml 中的sql 语句)注入程序中?
查看 Configuration.mappedStatements 属性
5、mybatis-plus 何时将 通用BaseMapper 的CURD mappedStatement 注入程序中?
查看类:MybatisMapperAnnotationBuilder,重写了MapperAnnotationBuilder 的parse 方法,在解析注解之前,注入了BaseMapper 中通用方法对应的 mappedStatement
6、如果mybatis 不跟spring 整合,那么整个入口类在哪?
查看类:SqlSessionFactoryBuilder.bulder(...);