spring集成ibatis,涉及到的一些核心类
来源:互联网 发布:cst软件下载 编辑:程序博客网 时间:2024/06/15 09:01
近期研究了下spring集成ibatis,涉及到的一些核心类,下面一个图大体的描述了这些类之间的一些关系:
1、ibatis通过SqlMapClient接口提供了访问数据库的相关操作。Spring的org.springframework.orm.ibatis.SqlMapClientFactoryBean类,负责创建SqlMapClient实体,具体的创建代码如下:
protected SqlMapClient buildSqlMapClient(Resource[] configLocations, Resource[] mappingLocations, Properties properties)throws IOException {if (ObjectUtils.isEmpty(configLocations)) {throw new IllegalArgumentException("At least 1 'configLocation' entry is required");}SqlMapClient client = null;SqlMapConfigParser configParser = new SqlMapConfigParser();for (int i = 0; i < configLocations.length; i++) {InputStream is = configLocations[i].getInputStream();try {client = configParser.parse(is, properties);}catch (RuntimeException ex) {throw new NestedIOException("Failed to parse config resource: " + configLocations[i], ex.getCause());}}if (mappingLocations != null) {SqlMapParser mapParser = SqlMapParserFactory.createSqlMapParser(configParser);for (int i = 0; i < mappingLocations.length; i++) {try {mapParser.parse(mappingLocations[i].getInputStream());}catch (NodeletException ex) {throw new NestedIOException("Failed to parse mapping resource: " + mappingLocations[i], ex);}}}return client;}2、从上面的代码可以看出,ibatis通过SqlMapConfigParser类的parse方法,解析对应的XML配置文件,从而构造出SqlMapClient的实体。
0 0
- spring集成ibatis,涉及到的一些核心类
- Spring与iBATIS的集成
- Spring与iBATIS的集成
- Spring与iBATIS的集成
- Spring与iBATIS的集成
- Spring与iBATIS的集成
- Spring与iBATIS的集成
- Spring与iBATIS的集成
- ibatis与spring的集成
- ibatis与spring的集成
- Spring与iBATIS的集成
- ibatis与spring的集成
- ibatis与spring的集成
- spring,ibatis集成的时候碰到问题
- 【Java心得】ibatis与spring的集成
- 【Java心得】ibatis与spring的集成
- 基于maven的springmvc + spring + ibatis 集成
- iBatis.Net的核心类
- 设计模式法则(一)
- poj 1504
- STM32F10存储器映像及Boot映射启动
- Extjs 4.0 Tab页
- MYSQL循环
- spring集成ibatis,涉及到的一些核心类
- 黑苹果安装难点与指导
- 关于学习c++
- storm集群的配置与启动
- /bin/bash^M: 坏的解释器: 没有那个文件或目录
- CVE-2013-0961
- BNU4072:最大和
- NSString和NSAttributedString的Attribute参数
- TC-SRM-609-DIV2-950- VocaloidsAndSongs