ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Qian" <daqiqi...@aol.com>
Subject A groupBy question
Date Thu, 13 Apr 2006 18:22:37 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title></title>
</head>
<body>
<font size="2"><font face="Arial,sans-serif">All, <br>
<br>
using groupBy, we can construct an object which contains a list of
objects, for example,<br>
<br>
&nbsp;&lt;resultMap id="MemberCoupon" class="MemberCoupon"
groupBy="couponId"&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;result column="coupon_id" property="couponId"
jdbcType="INTEGER"/&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;result property="savingCardStatuses"
resultMap="savingCardStatusMap" /&gt;<br>
&nbsp; &lt;/resultMap&gt;<br>
<br>
&nbsp; &lt;resultMap id="savingCardStatusMap" class="SavingCardStatus" &gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;result property="SavingCardId" column="card_id"
jdbcType="SMALLINT"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;result property="couponStatusId" column="status_id"
jdbcType="SMALLINT"/&gt;<br>
&nbsp; &lt;/resultMap&gt;<br>
<br>
Is there any way that I can put card_id and status_id in Map so that
the final object will comtain a Map, not a list of Maps?</font></font><font
 size="2"><font face="Arial,sans-serif"><br>
If&nbsp; a couponId has three saving cards, the Map will have three cardIds
and their corresponding status_id.<br>
<br>
Thanks,<br>
Tony<br>
</font></font>
</body>
</html>


Mime
View raw message