ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Chew <chew.a...@gmail.com>
Subject Can I build a SqlMapClient from multiple xml files?
Date Fri, 13 Mar 2009 02:23:44 GMT
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

Mime
View raw message