type
status
date
slug
summary
tags
category
icon
password
binding包的主要作用是处理Java方法和SQL语句的绑定关系,代理模式
主要涉及以下两个功能:
  • 维护mapper接口中方法和数据库操作节点的关联关系
  • 为mapper中的方法接入对应的数据库操作

基本类图

notion image

MapperRegistry

MapperProxyFactory

MapperProxy

MapperMethod

  • execute()
  • ParamMap<V> 增强HashMap
  • rowCountResult()
  • executeWithResultHandler()
  • executeForMany()-集合查询
  • executeForCursor()-游标
executeForMap类似。

SqlCommand

  • resolveMapperStatement()

MethodSignature

  • 参数解析ParamNameResolver

总结

notion image
notion image
 
  1. Mapper与MapperProxyFactory建立关联,维护在MapperRegistry中
  1. 建立接口方法和MapperMethod对象的关联关系维护在methodCache中