Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 90597 invoked from network); 7 Apr 2010 02:22:44 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Apr 2010 02:22:44 -0000 Received: (qmail 62981 invoked by uid 500); 7 Apr 2010 02:22:43 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 62962 invoked by uid 500); 7 Apr 2010 02:22:43 -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 62955 invoked by uid 99); 7 Apr 2010 02:22:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Apr 2010 02:22:43 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of clinton.begin@gmail.com designates 209.85.217.223 as permitted sender) Received: from [209.85.217.223] (HELO mail-gx0-f223.google.com) (209.85.217.223) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Apr 2010 02:22:36 +0000 Received: by gxk23 with SMTP id 23so344448gxk.15 for ; Tue, 06 Apr 2010 19:22:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:received:message-id:subject:to:content-type; bh=DBbrXrLUN/j9k/VW5E5Ap8d+FR5kH4Yyhnyy5g8pdUI=; b=HzIH12R6VsSoxSDwANmED9QJHkvATZeWoLTeCkqSncP4Mu7WKMzaScL8nKQhiVSWP5 CPTjVbbeFylYpAi1kGl1T4ROY37cokOnnNlbyxvikk2Pp62Uues9JMjxvgRsvkDuI2bV p2AFF04McGXgl+Pc4I/ZAtESn9M2qWl3jUow8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=WDSC7E/BhFKshCowxpmTMozpiDbYp6TRJPrzuy7sGeCpWW0EKR/9uA9DL67aDABRzG C4LETHKo9idMO6FuvE3yW1Rox8G0iQ59NjSM3GI1wGvtEX63opW4B3HtIW7IJfRxLJNI RCyqjNDNjTOBTH/GcHidacN8D4rdzupM/VG6c= MIME-Version: 1.0 Received: by 10.231.19.193 with HTTP; Tue, 6 Apr 2010 19:21:55 -0700 (PDT) In-Reply-To: <82A8ED22-22E3-4FDB-B500-BDD8822E3D00@peoplepowerco.com> References: <4BBA1202.9070302@bbs.darktech.org> <4BBBC713.3090306@burntmail.com> <82A8ED22-22E3-4FDB-B500-BDD8822E3D00@peoplepowerco.com> From: Clinton Begin Date: Tue, 6 Apr 2010 20:21:55 -0600 Received: by 10.231.162.85 with SMTP id u21mr440477ibx.95.1270606935411; Tue, 06 Apr 2010 19:22:15 -0700 (PDT) Message-ID: Subject: Re: [IBatis3-beta10] nested results for collection To: user-java@ibatis.apache.org Content-Type: multipart/alternative; boundary=005045013ed808cba304839c3be0 X-Virus-Checked: Checked by ClamAV on apache.org --005045013ed808cba304839c3be0 Content-Type: text/plain; charset=ISO-8859-1 If iBATIS finds ANY values for the mapped properties, it will create the object. Is it possible that the desc column is populated even when the index is null? On Tue, Apr 6, 2010 at 7:52 PM, Viv Kapadekar wrote: > Hi > I have a Class X containing a List of Class Y > > Class X { > String a > List b > } > > Class Y { > String index > String desc > } > > The resultMap I have is > > > > > > column="desc"/> --> > > > > This is fine, but I don't want the resulting X to have the collection b > set, if the "index" value is null. If index is null, even the value of b in > X should be null. I tried using and also tried creating a > separate sql, but no luck. Any ideas? > > -V > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org > For additional commands, e-mail: user-java-help@ibatis.apache.org > > --005045013ed808cba304839c3be0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable If iBATIS finds ANY values for the mapped properties, it will create the ob= ject.=A0 Is it possible that the desc column is populated even when the ind= ex is null?

On Tue, Apr 6, 2010 at 7:52 P= M, Viv Kapadekar <vivek@peoplepowerco.com> wrote:
Hi
I have a Class X containing a List of Class Y

Class X {
String a
List<Y> b
}

Class Y {
String index
String desc
}

The resultMap I have is

<resultMap id=3D"someID" type=3D"X">
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<id property=3D"a" column=3D&q= uot;id"/>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<collection property=3D&= quot;b" ofType=3D"Y">
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0<id property=3D"index" column=3D"index" />
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0<result property=3D"desc" column=3D"desc"/>= ; =A0-->
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0</collection>
</resultMap>

This is fine, but I don't want the resulting X to have the collection b= set, if the "index" value is null. If index is null, even the va= lue of b in X should be null. =A0I tried using <discriminator> and al= so tried creating a separate sql, but no luck. Any ideas?

-V



---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


--005045013ed808cba304839c3be0--