Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 92251 invoked from network); 15 Sep 2005 12:32:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Sep 2005 12:32:50 -0000 Received: (qmail 38294 invoked by uid 500); 15 Sep 2005 12:32:49 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 38268 invoked by uid 500); 15 Sep 2005 12:32:48 -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 38253 invoked by uid 99); 15 Sep 2005 12:32:48 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Sep 2005 05:32:47 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of brandon.goodin@gmail.com designates 64.233.170.206 as permitted sender) Received: from [64.233.170.206] (HELO rproxy.gmail.com) (64.233.170.206) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Sep 2005 05:32:58 -0700 Received: by rproxy.gmail.com with SMTP id c16so62422rne for ; Thu, 15 Sep 2005 05:32:46 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=udNPFDSFV3q141uINAjAzSxsBD9GEripPuItIPZXGiTcKSNuTtTCeyYYdfr2kMOrsm8ISpa23sIRGDvY1kKblHKO07WG7yNOuQ8KH4lg+VPtj0OHLgqS00Xkl0bKdOinRpUgHRw7Y0Hf4Q0OYGhOp4D40zLCgdCyQGnS8fHgml0= Received: by 10.38.13.77 with SMTP id 77mr294888rnm; Thu, 15 Sep 2005 05:32:46 -0700 (PDT) Received: by 10.38.74.11 with HTTP; Thu, 15 Sep 2005 05:32:46 -0700 (PDT) Message-ID: <2fe5ef5b050915053256193d3d@mail.gmail.com> Date: Thu, 15 Sep 2005 06:32:46 -0600 From: Brandon Goodin Reply-To: brandon.goodin@gmail.com To: user-java@ibatis.apache.org Subject: Re: N+1 select and object references In-Reply-To: <20050914124643.94601.qmail@web50903.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20050914124643.94601.qmail@web50903.mail.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N If you could provide more information about where this behavior is in iBatis as well as the code you are using to call it, that'd help us to see better what you are talking about. Thanks Brandon On 9/14/05, Mukul Goyal wrote: > I noticed that it is required (only when you are using the N+1 solution) = for > an Object that contain other objects (1:M relationships) to have BOTH a > getter and setter method. At first I didn't realize why this was required= , > but as I was debugging a problem I realized why.=20 > =20 > If the getter returns NULL during object population, IBATIS constructs a = new > List object and calls the setter on the parent object. However, when the > setter is called the List is empty. The IBATIS implementation banks on th= e > fact that you are maintaining the object inside of your bean. After it ca= lls > the setter with the empty List, it then goes and populates the List. I pu= t a > break point in my settter method and realized that the size of the list i= s > never greater than 0. This seems problematic because internally I do not > represent the content of the data as a list.=20 > =20 > Is this by design or is there a work around to this problem?=20 > =20 > Thanks,=20 > Mukul=20 >=20 >=20 > ________________________________ > Yahoo! for Good > Click here to donate to the Hurricane Katrina relief effort.=20 >=20 >