总结6: Mybatis源码分析和架构设计

一、Mybatis设计架构

1、架构图

 

 

2、流程图

 

 

二、源码解析系列

1、源码解析

https://www.bbsmax.com/A/rV57bKkRJP/

2、Plug的工作原理

https://www.cnblogs.com/qdhxhz/p/11390778.html

3、Dao没有实现类的思想(JDK动态代理)

https://www.cnblogs.com/hopeofthevillage/p/11384848.html

SqlSessionFactory sqlMapper = new SqlSessionFactoryBuilder().build(reader);

SqlSession session= sqlMapper.openSession();

TestTableMapper t= session.getMapper(TestTableMapper.class);

TestTable tt=(TestTable)t.selectByPrimaryKey("wwww");

 

 

三、Mybatis的拦截器,拦截的接口

Mybatis的四大接口是哪些: Executor,StatementHandler, ResultSetHandler, ParameterHandler

http://www.mybatis.cn/archives/81.html

 

四、Mybatis中涉及的涉及模式

http://www.mybatis.cn/archives/631.html

 

五、Spring事务的管理

 

六、Mybatis batch insert 返回主键设置

设置: useGeneratedKeys="true" keyProperty="suggestionId

@Param("list") foreach中 collection="list" 必须命名为list

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章