ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: ArrayList as parameter
Date Sat, 19 Mar 2005 16:12:07 GMT
This is an inappropriate use of a list.  A list is good for objects of
the same (or at least similar!) type.  In your case the list contains
completely different data.

You should use a Map for this, or better yet, a JavaBean.

Cheers,
Clinton


On Sat, 19 Mar 2005 15:03:12 +0530, srividhya umashanker
<srividhyau@gmail.com> wrote:
> ArrayList
> ----------------
> List list = new ArrayList();
> list.add("123");
> list.add("A");
> 
> queryForList("emp" ,list);
> 
> <select id="emp" resultClass="java.util.ArrayList"
> parameterClass="java.util.ArrayList">
>    SELECT employee_name  FROM employee
>    WHERE  employee_id= ? and grade=?
>  </select>
> 
> How to apply the iterate tag to get the following query
> 
>    SELECT employee_name  FROM employee   WHERE  employee_id= 123 and
> grade='A'
> 
>

Mime
View raw message