Mybatis原理

1. SqlSessionFactory

2.SqlSession

sqlSession实现类有:DefaultSqlSession ,  SqlSessionManager

SqlSessionFactory 实现类:DefaultSqlSessionFactory和 SqlSessionManager

根据DefaultSqlSession源码可以知道

似乎一切的一切,都是从配置对象Configuration中取出材料来 委托执行器去处理

 

查看部分 SqlSessionFactory源码可知道:

创建一个DefaultSqlSession并返回 贯穿Mybatis执行流程的Executor接口

 

SqlSessionManager分析:

SqlSessionManager同时实现了SqlSession和SqlSessionFactory

 

使用的代理是 JDK动态代理

 

Mybatis原理

 

Mybatis原理

Mybatis原理

Mybatis原理

Mybatis原理

 

Mybatis原理

Mybatis Mapper的代理对象的创建