Message from discussion
Collection and List of Strings
Received: by 10.100.93.17 with SMTP id q17mr1106072anb.54.1281711263668;
Fri, 13 Aug 2010 07:54:23 -0700 (PDT)
X-BeenThere: mybatis-user@googlegroups.com
Received: by 10.101.156.10 with SMTP id i10ls827318ano.3.p; Fri, 13 Aug 2010
07:54:22 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.101.141.14 with SMTP id t14mr196487ann.13.1281711261919; Fri,
13 Aug 2010 07:54:21 -0700 (PDT)
Received: by v41g2000yqv.googlegroups.com with HTTP; Fri, 13 Aug 2010 07:54:21
-0700 (PDT)
Date: Fri, 13 Aug 2010 07:54:21 -0700 (PDT)
In-Reply-To: <AANLkTinVF67E9r7Zr=LhDQ8B+aVEisB6WfC-0oa7UCBd@mail.gmail.com>
X-IP: 199.173.226.232
References: <307ddc72-f683-46ee-a911-4b942f22a797@l14g2000yql.googlegroups.com>
<AANLkTinVF67E9r7Zr=LhDQ8B+aVEisB6WfC-0oa7UCBd@mail.gmail.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;
Trident/4.0; IE6SP1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR
2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; IE6SP1; InfoPath.2; yie8),gzip(gfe)
Message-ID: <609a8f45-8402-43c6-b690-daaed7606874@v41g2000yqv.googlegroups.com>
Subject: Re: Collection and List of Strings
From: q111111 <q211222...@yahoo.com>
To: mybatis-user <mybatis-user@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Thank you for the suggestion.
Still returning a null list.
Before the question is asked by someone else ...
Running the query straight in database returns 6 rows (Tbl1 has 1 row
and Tbl2 has 6).
On Aug 13, 10:29=A0am, Simone Tripodi <simone.trip...@gmail.com> wrote:
> Hi!
> did you try with javaType=3D"java.util.ArrayList" instead of javaType=3D"=
list" ?
> let us know!
> Simo
>
> http://people.apache.org/~simonetripodi/http://www.99soft.org/
>
>
>
> On Fri, Aug 13, 2010 at 3:37 PM, q111111 <q211222...@yahoo.com> wrote:
> > I am missing something but I am not sure what.
> > I want to fill a list of strings.
> > Currently, the SimpleDomain does return a name with a null list.
>
> > Java:
> > public class SimpleDomain
> > {
> > =A0 =A0String name;
> > =A0 =A0List<String> someStrings;
> > =A0 =A0//getters and setters here
> > }
>
> > Mapper:
> > <select id=3D"MySuperQuery" resultMap=3D"MyMap">
> > =A0 =A0 select tbl1.lname as NAME, tlb2.lstring as MYSTRING
> > =A0 =A0 =A0 =A0from tbl1
> > =A0 =A0 =A0 =A0left outer join tbl2 on tbl1.id =3D tbl2.id
> > </select>
>
> > <resultMap id=3D"MyMap" type=3D"SimpleDomain">
> > =A0<result property=3D"name" column=3D"NAME"/>
> > =A0<collection property=3D"someStrings" javaType=3D"list" column=3D"MYS=
TRING"
> > ofType=3D"string"/>
> > </resultMap>
>
> > Thank you.- Hide quoted text -
>