Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 27036 invoked from network); 16 Jan 2006 13:57:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Jan 2006 13:57:48 -0000 Received: (qmail 37732 invoked by uid 500); 16 Jan 2006 13:57:46 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 37710 invoked by uid 500); 16 Jan 2006 13:57:45 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 37698 invoked by uid 99); 16 Jan 2006 13:57:45 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jan 2006 05:57:45 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [217.12.10.192] (HELO web25807.mail.ukl.yahoo.com) (217.12.10.192) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 16 Jan 2006 05:57:44 -0800 Received: (qmail 79537 invoked by uid 60001); 16 Jan 2006 13:57:22 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=na3JP7V5DivCO3jB+wS55wVCzlqxDEq3z6euqVwDJG9qISJq+1DC+BPy8s96SIdcTNS6oZJ1OW6Aobg/vS0d4+kJ5+HjZC0P96rX6+aD1j00daPGpVcO8Qiz9B88BFgl8ekIYvoTOYuGEhIi18kCCLIqoghKEpjVlhz5UXymSrI= ; Message-ID: <20060116135722.79535.qmail@web25807.mail.ukl.yahoo.com> Received: from [82.109.70.230] by web25807.mail.ukl.yahoo.com via HTTP; Mon, 16 Jan 2006 13:57:22 GMT Date: Mon, 16 Jan 2006 13:57:22 +0000 (GMT) From: Gareth Moorst Subject: Re: ResultMap, N+1 To: user-java@ibatis.apache.org In-Reply-To: <43C9446C.1030209@laposte.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-51676399-1137419842=:75337" Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --0-51676399-1137419842=:75337 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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 wrote: Tony, Indeed - looks like a bug. What is even more troubling is that I have another similar ResultMap that is working ok: 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. --0-51676399-1137419842=:75337 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
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. --0-51676399-1137419842=:75337--