ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dawson, Lewis" <Lewis.Daw...@Teradata.com>
Subject RE: returning an array List
Date Mon, 23 Feb 2009 20:40:28 GMT
Rashid,

In short, each row of the query result set is mapped to a new instance
of the "resultClass" class parameter you have specified when you call
slqMap.queryForList(). In sqlMap.queryForObject(), it maps a SINGLE row
to a new instance of the "resultClass" class parameter. I can't think of
any reason why you would want to map a single row to a new instance of a
List.

Lewis Dawson

-----Original Message-----
From: Larry Meadors [mailto:larry.meadors@gmail.com] 
Sent: Friday, February 20, 2009 11:26 AM
To: Rashid Jilani
Cc: user-java@ibatis.apache.org
Subject: Re: returning an array List

Look in the users guide. Please. :)

On Fri, Feb 20, 2009 at 12:11 PM, Rashid Jilani
<jilani@lifebiosystems.com> wrote:
> Thanks Larry it helped but I have a quick question.
>
> Why I can't do this
>
> <select id="getTradeList"  resultClass="java.util.List">
>
> sqlMap.queryForObject("getTradeList");
>
> -----Original Message-----
> From: Larry Meadors [mailto:larry.meadors@gmail.com]
> Sent: Friday, February 20, 2009 12:39 PM
> To: user-java@ibatis.apache.org
> Subject: Re: returning an array List
>
> Try this:
>
> <select id="getTradeList"  resultClass="string">
>
> return sqlMap.queryForList("getTradeList");
>
> Larry
>
>
>

Mime
View raw message