ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Qian" <daqiqi...@aol.com>
Subject Two Questions on iBATIS DAO
Date Thu, 30 Mar 2006 13:26:18 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title></title>
</head>
<body>
<font size="2" face="Arial,sans-serif"><font face="Arial,sans-serif">All,<br>
<br>
Got two questions on iBATIS DAO.<br>
<br>
1) I have two tables.&nbsp; Those two tables happen to have a column with
same name.&nbsp; I try to join those two table first and then use groupBy to
construct two lists, one for each table. The problem is that I cannot
use table qualifier to specify the data from a particular table, such
as C.expiration_date and S.expiration_date. <br>
<br>
&lt;resultMap id="savingCardMap" class="MemberSavingCard"
groupBy="savingCardId"&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;result property="savingCardId"
column="saving_card_id"
/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color="#0000ff">&lt;result property="expirationDate"
column="S.expiration_date" /&gt;&nbsp;&nbsp;&nbsp; // expiration_date from
saving_card
table</font><br>
&nbsp; &lt;/resultMap&gt;<br>
<br>
&nbsp; &lt;resultMap id="couponToInforteMap" class="Coupon"
groupBy="couponId"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;result property="couponId" column="coupon_id" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color="#0000ff">&lt;result property="expirationDate"
column="C.expiration_date" /&gt;&nbsp; // expiration_date from coupon table</font><br>
&nbsp; &lt;/resultMap&gt;<br>
<br>
select <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C.coupon_id,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C.expiration_date,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; S.saving_card_id,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; S.expiration_date<br>
from coupon as C, saving_card as S where ....<br>
<br>
2) if we use SqlMapClient, we can do batch transaction. Does DaoManager
support batch transaction similar to SqlMapClient? If not, is there
other way to do batch?<br>
<br>
thanks,<br>
Tony</font></font>
</body>
</html>


Mime
View raw message