Mybatis接口编程原理绪论.doc

Mybatis接口编程原理分析 Mybatis接口编程相关的类主要有MapperProxyFactory、MapperProxy、MapperMethod和MapperRegister四个类: MapperProxyFactory:通过类名我们可以猜到这是一个MapperProxy的工厂类,用于创建MapperProxy的,通过函数newInstance(SqlSession sqlSession)来创建MapperProxy的代理类。 源码如下: [java] view plain copy print?在CODE上查看代码片派生到我的代码片 //这个类赋值创建具体mapper接口代理对象的工厂 public class MapperProxyFactoryT { //具体Mapper接口的class对象 private final ClassT mapperInterface; //该接口下面的缓存,key是方法对象,value是对接口中方法对象的封装 private final MapMethod, MapperMethod methodCache = new ConcurrentHashMapMethod, MapperMethod(); public MapperProxyFactory(ClassT mapperI

文档评论(0)

1亿VIP精品文档

相关文档