Mybatis源码解析

读源码技巧:

  1. 猜(如果让你设计 你会如何设计)
  2. 调试(带着问题 具体看某一操作如何实现)
  3. 验证
  4. 整体框架过一遍
  5. 细节不必太纠结

核心接口:

  • SqlSession
  • SqlSessionFactory
  • ResultHandler

XML相关:

  • XMLConfigBuilder:读取XML配置文件
    • XPathParser:根据XPath解析

重点:

  • MapperRegistry:负责Mapper接口处理
    • MapperAnnotationBuilder
  • Configuration

MapperProxy:

  • invoke

MapperMethod

ParamNameResolver

MappedStatement

Executor

StatementHandler

MetaObject:拦截器元数据

results matching " "

No results matching " "

results matching " "

No results matching " "