ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Sherwin <alex.sher...@acadiasoft.com>
Subject Re: Can I build a SqlMapClient from multiple xml files?
Date Fri, 13 Mar 2009 13:37:00 GMT
We write individual files with <sqlMap> entries that encompass objects, 
then link them into a <sqlMapConfig> using the <sqlMap resource=""/> tag.

In this way, you can create a very simple sqlMapConfig for your whole 
project that just needs to reference all the sqlMap's you want..

Alex Chew wrote:
> Hi all,
> Many of our projects were built in a component-based way. Each 
> component got it's own SqlMapConfig and DaoConfig files. We must 
> handly merge many of those files into a single one to build a whole 
> application with many components. Is there a way to build a 
> SqlMapClient or DaoManager from multiple xml files?
> For example,now we use following codes to build a SqlMapClient,the 
> same to the demo,
> Reader reader = 
> Resources.getResourceAsReader("com/mydomain/data/SqlMapConfig.xml");
> sqlMapper = SqlMapClientBuilder.buildSqlMapClient(reader);
> Does there have a way like below pesudo codes?
> Reader reader1 = 
> Resources.getResourceAsReader("com/mydomain/comp1/SqlMapConfig.xml");
> Reader reader2 = 
> Resources.getResourceAsReader("com/mydomain/comp2/SqlMapConfig.xml");
> SqlMapClientBuilder.buildSqlMapClient(reader1);
> SqlMapClientBuilder.buildSqlMapClient(reader2);
> sqlMapper = SqlMapClientBuilder.getSqlMapClient();
> Thanks in advace.
> Alex

View raw message