ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yannick Le Teigner <yannick.leteig...@laposte.net>
Subject Re: ResultMap, N+1
Date Sat, 14 Jan 2006 18:35:24 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Tony,<br>
<br>
Indeed - looks like a bug.<br>
<br>
What is even more troubling is that I have another similar ResultMap
that is working ok:<br>
<tt>&nbsp;&nbsp;&nbsp; &lt;resultMap id="subMarketMap" class="java.util.LinkedHashMap"
&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;result property="id"
column="s_id" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;result property="siret"
column="siret" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;result property="name"
column="s_name" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;result property="percentage"
column="s_percentage" /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/resultMap&gt;<br>
<br>
&nbsp;&nbsp;&nbsp; &lt;resultMap id="marketMap" class="com.montecristo.company.Market"
groupBy="id"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;result property="id"
column="id" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;result property="name"
column="name" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;result property="location"
column="location" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;result property="volume"
column="volume" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;result property="value"
column="value" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;result property="leader"
column="leader" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;result property="growth"
column="growth" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;result property="percentage"
column="percentage" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;result property="growthComment"
column="growth_comment"
/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;result property="marketTypeId"
column="market_type_id" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;result property="customerProfileId"
column="customer_profile_id" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;result property="subMarket"
resultMap="Orders.subMarketMap"
/&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/resultMap&gt;<br>
<br>
&nbsp;&nbsp;&nbsp; &lt;select id="getMarket" parameterClass="java.lang.String"<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
resultMap="marketMap"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; SELECT market.siret, market.id, market.name, location,volume,
value,leader, market.percentage, growth,growth_comment, market_type_id,
customer_profile_id, submarket.id as s_id, submarket.name as s_name,
submarket.percentage as s_percentage<br>
&nbsp; &nbsp; FROM market LEFT JOIN submarket ON market.siret=submarket.siret
WHERE market.siret=#value:varchar#<br>
&nbsp;&nbsp;&nbsp; &lt;/select&gt;</tt><br>
<br>
<br>
Thanks,<br>
Yannick<br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:DaqiQian2@aol.com">DaqiQian2@aol.com</a>
wrote:
<blockquote cite="mid279.32db547.30fa81fc@aol.com" type="cite">
  <meta charset="US-ASCII" http-equiv="Content-Type"
 content="text/html; ">
  <meta content="MSHTML 6.00.2900.2802" name="GENERATOR">
  <div>Yannick,</div>
  <div>&nbsp;</div>
  <div>I'm having similar problem.&nbsp; please see my previous post,
"groupBy issue".</div>
  <div>&nbsp;</div>
  <div>thanks,</div>
  <div>Tony&nbsp;</div>
</blockquote>
</body>
</html>

Mime
View raw message