ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gareth Moorst <gazj...@yahoo.co.uk>
Subject Re: ResultMap, N+1
Date Mon, 16 Jan 2006 13:57:22 GMT
I think this is because of a different issue - when dealing with List properties, I believe
iBatis creates the list, sets it into the parent class, then adds objects to the lists, so
if you are doing any copying of lists in the setAcc(List accs) method, then you will be copying
an empty list.

Hope this helps,
Gareth Moorst

Yannick Le Teigner <yannick.leteigner@laposte.net> wrote:           Tony,
 
 Indeed - looks like a bug.
 
 What is even more troubling is that I have another similar ResultMap that is working ok:
     <resultMap id="subMarketMap" class="java.util.LinkedHashMap" >
         <result property="id" column="s_id" />
         <result property="siret" column="siret" />
         <result property="name" column="s_name" />
         <result property="percentage" column="s_percentage" />
     </resultMap>
 
     <resultMap id="marketMap" class="com.montecristo.company.Market" groupBy="id">
         <result property="id" column="id" />
         <result property="name" column="name" />
         <result property="location" column="location" />
         <result property="volume" column="volume" />
         <result property="value" column="value" />
         <result property="leader" column="leader" />
         <result property="growth" column="growth" />
         <result property="percentage" column="percentage" />
         <result property="growthComment" column="growth_comment" />
         <result property="marketTypeId" column="market_type_id" />
         <result property="customerProfileId" column="customer_profile_id" />
         <result property="subMarket" resultMap="Orders.subMarketMap" />
     </resultMap>
 
     <select id="getMarket" parameterClass="java.lang.String"
                            resultMap="marketMap">
      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
     FROM market LEFT JOIN submarket ON market.siret=submarket.siret WHERE market.siret=#value:varchar#
     </select>
 
 
 Thanks,
 Yannick
 
 DaqiQian2@aol.com wrote:          Yannick,
    
   I'm having similar problem.  please see my previous post, "groupBy issue".
    
   thanks,
   Tony 
  


		
---------------------------------
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre.
Mime
View raw message