type
status
date
slug
summary
tags
category
icon
password
建造者模式

类图

notion image

MapperBuilderAssistant

一个非建造者的对象构建辅助类
  • 缓存构建

SqlSourceBuilder

生成StaticSqlSource,将#{}替换为?,StaticSqlSource为SqlSource其中的一个子类
其他对象并不由这个builder创建,StaticSqlSource可以构建BoundSql

CacheRefResolver

Mapper在多个namespace之间共享缓存,例如在mapperB中通过<cache-ref/>引入mapperA的命名空间,那么mapperB就可以使用MapperA的缓存了

ResultMapResolver

resultMap继承

ParameterExpression

属性解析,按照键值对存储

XML文件解析

notion image
  • XMLMapperEntityResolver
  • XMLConfigBuilder
解析mapper结点
  • XMLMapperBuilder
  • XMLStatementBuilder
解析<include/>
notion image

注解解析

根据注解格式化SQL

间接注解

  • ProviderContext
  • ProviderMethodResolver
  • ProviderSqlSource SQL生成