1.MapperProxyFactory是Mapper接口的动态代理工厂类:经典的C/S架构同步访问模型的实现
方法代理类MapperProxy, 其他:MapperMethod
/**
* Copyright 2009-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.binding;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.ibatis.session.SqlSession;
/**
* @author Lasse Voss
*/
public class MapperProxyFactory<T> {
private final Class<T> mapperInterface;
private final Map<Method, MapperMethod> methodCache = new ConcurrentHashMap<Method, MapperMethod>();
public MapperProxyFactory(Class<T> mapperInterface) {
this.mapperInterface = mapperInterface;
}
public Class<T> getMapperInterface() {
return mapperInterface;
}
public Map<Method, MapperMethod> getMethodCache() {
return methodCache;
}
@SuppressWarnings("unchecked")
protected T newInstance(MapperProxy<T> mapperProxy) {
return (T) Proxy.newProxyInstance(mapperInterface.getClassLoader(), new Class[] { mapperInterface }, mapperProxy);
}
public T newInstance(SqlSession sqlSession) {
final MapperProxy<T> mapperProxy = new MapperProxy<T>(sqlSession, mapperInterface, methodCache);
return newInstance(mapperProxy);
}
}
分享到:
相关推荐
mybatis-3.5.9 源码(mybatis-3-mybatis-3.5.9.tar.gz)
mybatis-3.5.9 源码(mybatis-3-mybatis-3.5.9.zip)
mybatis-plus源码(mybatis-plus-3.5.1.zip)
mybatis源码是mybatis-3.2.6的源码,用户使用mybatis时可以进行参考
3.4.2开发工具 mybatis-3.4.2开发工具 mybatis-3.4.2开发工具 mybatis-3.4.2开发工具 mybatis-3.4.2开发工具 mybatis-3.4.2开发工具 mybatis-3.4.2开发工具 mybatis-3.4.2开发工具 mybatis-3.4.2开发工具 mybatis-3
源码下载!绝对的mybatis源码,在Myeclipes或Eclipse中直接引入即可看源码!
mybatis-plus-sample-reduce-springmvc: 简化掉默认mapper类示例(Spring MVC版本) mybatis-plus-sample-generator: 代码生成器示例 mybatis-plus-sample-crud: 完整 CRUD 示例 mybatis-plus-sample-wrapper: 条件...
赠送jar包:mybatis-generator-core-1.3.7.jar; 赠送原API文档:mybatis-generator-core-1.3.7-javadoc.jar; 赠送源代码:mybatis-generator-core-1.3.7-sources.jar; 赠送Maven依赖信息文件:mybatis-generator-...
mybatis-plus源码(mybatis-plus-3.5.1.tar.gz)
mybatis-3.2.7.jar mybatis-3.2.2.jar mybatis-3.1.1.jar
赠送jar包:mybatis-plus-annotation-3.1.0.jar; 赠送原API文档:mybatis-plus-annotation-3.1.0-javadoc.jar; 赠送源代码:mybatis-plus-annotation-3.1.0-sources.jar; 赠送Maven依赖信息文件:mybatis-plus-...
mybatis在持久层框架中还是比较火的,一般项目都是基于ssm。虽然mybatis可以直接在xml中...《MyBatis-Plus入门文档》主要介绍了MyBatis-Plus入门使用,以及关于mybatis-plus的更多介绍及特性,感兴趣的可以下载学习一下
MyBatis3_用户指南--MyBatis-3-User-Guide-zh_CN.pdf 非常实用
mybatis mybatis-spring-boot-starter-2.0.0.jar下载
mybatis-3-mybatis-3.5.7.zip源码
赠送jar包:mybatis-plus-annotation-3.5.1.jar; 赠送原API文档:mybatis-plus-annotation-3.5.1-javadoc.jar; 赠送源代码:mybatis-plus-annotation-3.5.1-sources.jar; 赠送Maven依赖信息文件:mybatis-plus-...
赠送jar包:mybatis-generator-core-1.3.5.jar; 赠送原API文档:mybatis-generator-core-1.3.5-javadoc.jar; 赠送源代码:mybatis-generator-core-1.3.5-sources.jar; 包含翻译后的API文档:mybatis-generator...
赠送jar包:mybatis-spring-boot-autoconfigure-2.1.1.jar; 赠送原API文档:mybatis-spring-boot-autoconfigure-2.1.1-javadoc.jar; 赠送源代码:mybatis-spring-boot-autoconfigure-2.1.1-sources.jar; 赠送...
mybatis-spring-boot-starter-2.1.3.jarmybatis-spring-boot-starter-2.1.3.jarmybatis-spring-boot-starter-2.1.3.jar
赠送jar包:mybatis-spring-boot-autoconfigure-2.1.1.jar; 赠送原API文档:mybatis-spring-boot-autoconfigure-2.1.1-javadoc.jar; 赠送源代码:mybatis-spring-boot-autoconfigure-2.1.1-sources.jar; 赠送...