ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Schrader" <tschra...@gmail.com>
Subject Re: Generate a list of Integers?
Date Thu, 11 May 2006 17:28:59 GMT
Smashing.

Yeah, usage of queryForList() versus queryForObject() will dictate
whether you get a List or an Integer.  That said,  don't use this
query with queryForObject() because it will blow up since there's more
than one record.

Cheers,

Ted

On 11/05/06, John Moore <john@jmsd.co.uk> wrote:
> Ted Schrader wrote:
>
> > Hi John,
> >
> > I'm not sure if this will do it, but try this:
> >
> > <select id="myQuery" resultClass="java.lang.Integer">
> >   SELECT id
> >       FROM ID_TABLE
> > </select>
> >
> Spot on! It worked fine, thanks. I was getting confused about what the
> result class meant, as this actually returns a List of Integers, not an
> Integer.
>
> John
>
>
> --
> ==============================================
> John Moore  -  Norwich, UK  -  john@jmsd.co.uk
> ==============================================
>

Mime
View raw message