Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 90841 invoked from network); 14 Jan 2006 14:41:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Jan 2006 14:41:40 -0000 Received: (qmail 56317 invoked by uid 500); 14 Jan 2006 14:41:38 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 56302 invoked by uid 500); 14 Jan 2006 14:41:37 -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 56291 invoked by uid 99); 14 Jan 2006 14:41:37 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Jan 2006 06:41:37 -0800 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=RCVD_NUMERIC_HELO X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [66.171.59.140] (HELO smtp.vzavenue.net) (66.171.59.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Jan 2006 06:41:36 -0800 Received: from 131.227.171.66.subscriber.vzavenue.net (HELO [66.171.227.131]) ([66.171.227.131]) by smtp.vzavenue.net with ESMTP; 14 Jan 2006 09:41:15 -0500 X-REPUTATION: None X-REMOTE-IP: 66.171.227.131 X-BrightmailFiltered: true X-Brightmail-Tracker: AAAAAA== X-IronPort-AV: i="3.99,367,1131339600"; d="scan'208"; a="2725654:sNHT14732343" Message-ID: <43C90D89.50702@laposte.net> Date: Sat, 14 Jan 2006 09:41:13 -0500 From: Yannick Le Teigner User-Agent: Thunderbird 1.5 (X11/20051201) MIME-Version: 1.0 To: user-java@ibatis.apache.org Subject: ResultMap, N+1 Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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 Hi, I have a problem with a resultMap. My iBatis is: The query returns below results: id | cid | cname | sname | aid | aname | anumber ----+-----+------------------------+-------------+-----+--------------------------+--------- 2 | 4 | Produits Exeptionnels | Subventions | 12 | Cpte Associ� - C. PERRIN | 45614 2 | 4 | Produits Exeptionnels | Subventions | 22 | Cpte MCC | 41101 3 | 3 | Charges Financi�res | Taxes | | | 4 | 1 | Revenues | Ventes | | | 5 | 2 | Charges d'Exploitation | Lab | | | The problem is that the main object (Subcategory) gets correctly created (4 times), and that the LedgerAccount "sub-object" gets also correctly created for Subcategory #1 (with id=2), but it does not get associated with its parent Subcategory. Here are some traces: Subcategory Constructor id = 2 setAcc: null setAcc: [] new account new account Subcategory Constructor id = 3 setAcc: null setAcc: [] Subcategory Constructor id = 4 setAcc: null setAcc: [] Subcategory Constructor id = 5 setAcc: null setAcc: [] You can see that for each object is created correctly, but that the LedgerAccount created for the 1st object is created -after- the call to Subcategory.setAcc(), and does not get associated with it. acc is defined as a List in Subcategory. Thanks for any help! Yannick