mybatis基本原理
2022-02-19 15:30:01 0 举报
基本执行流程
作者其他创作
大纲/内容
key: 全限定类名+方法名value:MappedStatement
sqlsession
TestMapper mapperList<Test> all = mapper.all();
获取结果,执行结束
Configuration
TestMapper mapper = sqlSession.getMapper(TestMapper.class);
mapperRegistry
执行
数据源信息
生成代理对象,TestMapper
MappedStatement:执行的SQL,入参,返回封装
所有Mapper.xml的注册信息
sqlSessionFactory
读取mybatis配置文件
xml中namespace对应的mapper接口
MapperProxyFactory<T> mapperProxyFactory = (MapperProxyFactory)this.knownMappers.get(type);return mapperProxyFactory.newInstance(sqlSession);
收藏
0 条评论
下一页