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