Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 50008 invoked from network); 13 Mar 2009 09:54:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Mar 2009 09:54:17 -0000 Received: (qmail 90973 invoked by uid 500); 13 Mar 2009 09:54:15 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 90958 invoked by uid 500); 13 Mar 2009 09:54:15 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 90943 invoked by uid 99); 13 Mar 2009 09:54:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Mar 2009 02:54:15 -0700 X-ASF-Spam-Status: No, hits=-1.8 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of alistair.young@logica.com designates 207.46.51.80 as permitted sender) Received: from [207.46.51.80] (HELO SG2EHSOBE004.bigfish.com) (207.46.51.80) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Mar 2009 09:54:04 +0000 Received: from mail80-sin-R.bigfish.com (10.3.40.3) by SG2EHSOBE004.bigfish.com (10.3.40.24) with Microsoft SMTP Server id 8.1.340.0; Fri, 13 Mar 2009 09:53:40 +0000 Received: from mail80-sin (localhost.localdomain [127.0.0.1]) by mail80-sin-R.bigfish.com (Postfix) with ESMTP id 0AE5618800BF for ; Fri, 13 Mar 2009 09:53:39 +0000 (UTC) X-BigFish: VPS-17(zz9370P14ffO936fKzz1202hzz5a6ciz2fh6bh61h) X-Spam-TCS-SCL: 0:0 Received: by mail80-sin (MessageSwitch) id 1236938017108269_6510; Fri, 13 Mar 2009 09:53:37 +0000 (UCT) Received: from c1-ex001.groupinfra.com (unknown [213.86.115.108]) by mail80-sin.bigfish.com (Postfix) with ESMTP id 4C6758D0050 for ; Fri, 13 Mar 2009 09:53:35 +0000 (UTC) Received: from uk-ex003.groupinfra.com ([158.234.38.247]) by c1-ex001.groupinfra.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 13 Mar 2009 09:53:35 +0000 Received: from uk-ex007.groupinfra.com ([158.234.24.97]) by uk-ex003.groupinfra.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 13 Mar 2009 09:53:34 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C9A3C1.92F5C6C3" Subject: RE: Can I build a SqlMapClient from multiple xml files? Date: Fri, 13 Mar 2009 09:53:33 +0000 Message-ID: In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Can I build a SqlMapClient from multiple xml files? thread-index: AcmjgtAeu9hVp/ufRj6PLst3LlZaSwAPa/5A References: From: "Young, Alistair" To: X-OriginalArrivalTime: 13 Mar 2009 09:53:34.0750 (UTC) FILETIME=[930713E0:01C9A3C1] X-Virus-Checked: Checked by ClamAV on apache.org ------_=_NextPart_001_01C9A3C1.92F5C6C3 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I don't believe that iBATIS provides this out of the box. Maybe something planned for iBATIS 3? = We had a similar requirement and so have written a fairly simple class to read a SqlMapConfig file into memory, and then insert any required typehandlers and SQLMaps dynamically (JAXP). The resulting SqlMapConfig file can then be fed into iBATIS as usual. = This also provides some boons for our testing environment - the SqlMapConfigBuilder class can root out any SQLMaps/typehandlers that can't be found on classpath and build a resulting SQLMap that iBATIS should be guaranteed to process. Developers working on small subsets of the whole system can thus use a centralised iBATIS configuration without worrying about the visibility of SQLMaps that they don't really need. = = Alistair. ________________________________ From: Alex Chew [mailto:chew.alex@gmail.com] = Sent: 13 March 2009 02:24 To: user-java@ibatis.apache.org Subject: Can I build a SqlMapClient from multiple xml files? 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 =3D Resources.getResourceAsReader("com/mydomain/data/SqlMapConfig.xml"); sqlMapper =3D SqlMapClientBuilder.buildSqlMapClient(reader); = Does there have a way like below pesudo codes? Reader reader1 =3D Resources.getResourceAsReader("com/mydomain/comp1/SqlMapConfig.xml"); Reader reader2 =3D Resources.getResourceAsReader("com/mydomain/comp2/SqlMapConfig.xml"); SqlMapClientBuilder.buildSqlMapClient(reader1); SqlMapClientBuilder.buildSqlMapClient(reader2); sqlMapper =3D SqlMapClientBuilder.getSqlMapClient(); = Thanks in advace. Alex Please help Logica to respect the environment by not printing this email /= Merci d'aider Logica =E0 pr=E9server l'environnement en =E9vitant d'impri= mer ce mail / Bitte drucken Sie diese Nachricht nicht aus und helfen Sie s= o Logica dabei die Umwelt zu schuetzen / Por favor ajude a Logica a respe= itar o ambiente n=E3o imprimindo este correio electr=F3nico. This e-mail and any attachment is for authorised use by the intended recipi= ent(s) only. It may contain proprietary material, confidential information = and/or be subject to legal privilege. It should not be copied, disclosed to= , retained or used by, any other party. If you are not an intended recipien= t then please promptly delete this e-mail and any attachment and all copies= and inform the sender. Thank you. ------_=_NextPart_001_01C9A3C1.92F5C6C3 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
I don't believe that iBATIS provides this out of t= he = box.  Maybe something planned for iBATIS 3?
 
We had a similar requirement and so have written a= fairly = simple class to read a SqlMapConfig file into memory, and then insert any = required typehandlers and SQLMaps dynamically (JAXP).  The resulting = SqlMapConfig file can then be fed into iBATIS as usual.
=
 
This also provides some boons for our testing envi= ronment - = the SqlMapConfigBuilder class can root out any SQLMaps/typehandlers that ca= n't = be found on classpath and build a resulting SQLMap that iBATIS should be = guaranteed to process.  Developers working on small subsets of the who= le = system can thus use a centralised iBATIS configuration without worrying abo= ut = the visibility of SQLMaps that they don't really need.
 
 
Alistair.


From: Alex Chew [mailto:chew.alex@gmail= .com] =
Sent: 13 March 2009 02:24
To: = user-java@ibatis.apache.org
Subject: Can I build a SqlMapClient f= rom = multiple xml files?

Hi all,
 
Many of our projects were bu= ilt in = a component-based way. Each component got it's own SqlMapConfig and DaoConf= ig = 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 SqlMapCli= ent = or DaoManager from multiple xml files?
 
For example,now we use follo= wing = codes to build a SqlMapClient,the same to the demo,
Reader reader =3D = Resources.getResourceAsReader("com/mydomain/data/SqlMapConfig.xml");
sql= Mapper = =3D SqlMapClientBuilder.buildSqlMapClient(reader);
 
Does there have a way like below pesudo = codes?
Reader reader1 =3D = Resources.getResourceAsReader("com/mydomain/comp1/SqlMapConfig.xml");
Reader reader2 =3D = Resources.getResourceAsReader("com/mydomain/comp2/SqlMapConfig.xml");
SqlMapClientBuilder.buildSqlMapClient(reader1);
SqlMapClientBuilder.buildSqlMapClient(reader2);
sqlMapper =3D = SqlMapClientBuilder.getSqlMapClient();
 
Thanks in advace.
Alex

Please h= elp Logica to respect the environment by not printing this email / Merci = d'aider Logica =E0 pr=E9server l'environnement en =E9vitant d'imprimer ce m= ail / Bitte drucken Sie diese Nachricht nicht aus und helfen Sie so Logica= dabei die Umwelt zu schuetzen / Por favor ajude a Logica a respeitar o a= mbiente n=E3o imprimindo este correio electr=F3nico.=0D =0D =0D =0D This e-mail and any attachment is for authorised use by the intended recipi= ent(s) only. It may contain proprietary material, confidential information = and/or be subject to legal privilege. It should not be copied, disclosed to= , retained or used by, any other party. If you are not an intended recipien= t then please promptly delete this e-mail and any attachment and all copies= and inform the sender. Thank you.=0D ------_=_NextPart_001_01C9A3C1.92F5C6C3--