mybatis学习笔记。
0x00 阅读源代码
下载源代码
- 代码仓库地址 https://github.com/mybatis/mybatis-3.git
- 阅读版本号
myabtis-3.5.0 - 下载版本
git clone -b mybatis-3.5.0 https://github.com/mybatis/mybatis-3.git- 由于github下载速度是在太慢了,这里用gitee克隆一个镜像。
- 下载版本
git clone -b mybatis-3.5.0 https://gitee.com/Z201/mybatis-3.git
查看源代码结构
- 查看项目主要文件夹
tree -d L 2
.
├── src
│ ├── main # 源代码
│ ├── site # 站点稳当
│ └── test # 单元测试
└── travis # 官方的ci集成
- 查看项目源码主目录
tree -d src/main -L 5
src/main
└── java
└── org
└── apache
└── ibatis
├── annotations # 注解
├── binding # 代理
├── builder # 构造
├── cache # 缓存
├── cursor # 返回值类型为游标的方法
├── datasource # 数据源
├── exceptions # 异常
├── executor # 数据操作具体执行
├── io # 文件流
├── jdbc # jdbc模块
├── lang # 工具
├── logging # 日志
├── mapping # 映射、参数、结果集。
├── parsing # 解析器
├── plugin # 插件
├── reflection # 反射
├── scripting # sql解析
├── session # 接口层会话
├── transaction # 事物
└── type # 类型
- 将项目导入idea中,就可以看到完整的源代码了。
0x01 根据官方文档快速入门
强烈推荐认真阅读mybatis的官方文档。
- 官方文档地址 : http://www.mybatis.org/mybatis-3/zh/getting-started.html