美文网首页
Mybatis执行过程详解

Mybatis执行过程详解

作者: engineer_tang | 来源:发表于2022-02-16 20:04 被阅读0次

Mybatis plus是Mybatis的增强版,这里直接分析Mybatis plus。

image.png

通过加断点可以知道,Mapper是一个代理对象,针对该对象对应类来分析一下。


image.png

1. MybatisMapperProxy类

image.png

从 MapperProxy copy 过来,对应Mybatis的MapperProxy类。在调用代理对象的方法时,会自动调入invoke方法,具体原因待研究。

2. Configuration类

通过statement字符串获取MappedStatement对象
MybatisSimpleExecutor类中创建StatementHandler对象

3. MybatisMapperMethod类

4. DefaultSqlSession类

5. MappedStatement类

相关文章

网友评论

      本文标题:Mybatis执行过程详解

      本文链接:https://www.haomeiwen.com/subject/osprlrtx.html