Configure SqlMapClientBuilder with multiple resources -----------------------------------------------------
Key: IBATIS-381 URL: https://issues.apache.org/jira/browse/IBATIS-381 Project: iBatis for Java Issue Type: Improvement Components: SQL Maps Affects Versions: 2.3.0 Reporter: Marco Beelen I would like to have the ability to configure an SqlMapClientBuilder using multiple sqlMapConfig.xml-files. I'm working on a multi-module project using maven2 to build a webapplication. The project requires some common code for all applications in our organisation and some project specific code. In the common-modules and in one of project specific module I need some database access and would like to use iBatis SqlMap for this. Each of the modules has their own sqlMapConfig-file which defines some TypeHandlers and sqlMap resources. ( Mainly used to for unit testing the modules ) In my webapp I need to have the sqlMap-resources loaded from at least to modules. Now I need to write one sqlMapConfig-webapp.xml with duplicaties all the entries of typeHandlers and sqlMap-resources. I'm using Spring to configure my entire application and for the sqlMapClient it looks like this: <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> <property name="configLocation" value="classpath:/sqlMapConfig-webapp.xml" /> <property name="dataSource" ref="dataSource" /> </bean> I would like to have support for: <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> <property name="configLocations"> <list> <value>classpath:/sqlMapConfig-common.xml" </value> <value>classpath:/sqlMapConfig-project.xml" </value> </list> </property> <property name="dataSource" ref="dataSource" /> </bean> Prior to Spring supporting this, iBatis should be able to handle loading multiple config-files, so I would like to see the following methods being added: public static SqlMapClient buildSqlMapClient(java.io.Reader[] readers); public static SqlMapClient buildSqlMapClient(java.io.Reader[] readers, java.util.Properties props) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira