1. MapperProxyFactory 代理工厂类
 
 作用就是用来创建mapper代理类
 
 有两个成员变量
 
 final Class<T> mapperInterface mapper对应的接口
 
 Map<Method, MapperMethod> methodCache = new ConcurrentHashMap<Method, MapperMethod>()
 
 newInstance 方法 通过动态代理生成代理对象
 
 2. MapperProxy mapper代理类
 
 主要就一个invoke方法
 
 判断如果是object类型,直接执行方法,如果是其它类型,执行MapperMethod#execute方法,并将方法缓存到map中
 
 3. MapperMethod mapper方法
 
 主要方法是execute
 
 根据是insert,update,delete还是select拼装参数,然后执行sql返回结果
 
 4. MapperRegistry Mapper注册类
 
 getMapper 通过mpper代理工厂获取mapper代理类实例
 
 addMapper 将mapper放一个map里缓存起来,还有个注解parse没大看懂
 
  
 
转载于:https://www.cnblogs.com/liguangming/p/9527891.html