ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher.Mathru...@sybase.com
Subject Distributed DataSources and SQL Maps
Date Thu, 23 Feb 2006 21:47:34 GMT

<br><font size=2 face="sans-serif">My problem is as follows:</font>
<br>
<br><font size=2 face="sans-serif">Customer (POJO) -&gt; CustomerDao -&gt;
CustomerDaoImpl -&gt; CustomerSQLMap -&gt; DataSource1</font>
<br>
<br><font size=2 face="sans-serif">CustomerBilling (POJO) -&gt; CustomerBillingDao
-&gt; CustomerBillingDaoImpl -&gt; CustomerBillingSQLMap -&gt; DataSource2</font>
<br>
<br><font size=2 face="sans-serif">CustomerBilling object has a Customer
object that is accessible with a get method. What I would like to do in
the CustomerBilling SQL Map is as follows:</font>
<br>
<br><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; </font><font
size=2 color=blue>&lt;</font><font size=2 color=#800000>resultMap</font><font
size=2 color=red>
id</font><font size=2 color=blue>=&quot;</font><font size=2>CustomerBillingResult</font><font
size=2 color=blue>&quot;</font><font size=2 color=red>
class</font><font size=2 color=blue>=&quot;</font><font size=2>com.sybase.cosmos.domain.CustomerBilling</font><font
size=2 color=blue>&quot;&gt;</font>
<br><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;
&nbsp; </font><font size=2 color=blue>&lt;</font><font size=2
color=#800000>result</font><font size=2 color=red>
column</font><font size=2 color=blue>=&quot;</font><font size=2>customer_no</font><font
size=2 color=blue>&quot;</font><font size=2 color=red>
property</font><font size=2 color=blue>=&quot;</font><font size=2>customer</font><font
size=2 color=blue>&quot;</font><font size=2 color=red>
select</font><font size=2 color=blue>=&quot;</font><font size=2>Customer-findByPrimaryKey</font><font
size=2 color=blue>&quot;/&gt;</font>
<br>
<br>
<br><font size=2 face="sans-serif">The problem with the above SQL Map is
that when the Customer-findByPrimaryKey is invoked it is trying to use
<b>DataSource2 </b>associated with the CustomerBillingDao, not <b>DataSource1
</b>associated with the CustomerDao, so I get an exception because the
table does not exist within the CustomerBillingDao DataSource.</font>
<br>
<br><font size=2 face="sans-serif">How can I tell iBatis to use the correct
DataSource for this query?</font>
<br>
<br><font size=2 face="sans-serif">Thanks very much....</font>
<br><font size=2 face="sans-serif"><br>
Chris Mathrusse<br>
christopher.mathrusse@sybase.com<br>
Sybase, Inc<br>
One Sybase Drive<br>
Dublin, CA 94568<br>
(925) 236-5553</font>

Mime
View raw message