You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Ashish Kulkarni <as...@gmail.com> on 2008/01/03 19:46:34 UTC

question about parameterMap and java class

Hi
I have a class like below with get and set method
public ColorClass
{
private String name, desc;

public void setName(String _name)
{
this.name = _name;
}
public String getName()
{
return name;
}

}

How can i define this ColorClass in parameterMap and use it in SQL statement
for varaible substituation.
<parameterMap mymap" class="java.util.Map">
     <parameter property="id" javaType="java.util.List" />
</parameterMap>
where id is list of ColorClass,

I have a SQL statement as below

select name, id from mytable

<dynamic prepend="where">
<iterate prepend="AND" property="id" open="("
close=")" conjunction="OR">
C064ID=#id[]#
</iterate>
</dynamic>

I want to use getName method to get name of the colorclass,

Re: question about parameterMap and java class

Posted by Stephen Boyd <sw...@gmail.com>.
Have you tried

<dynamic prepend="where">
<iterate prepend="AND" property="id" open="("
close=")" conjunction="OR">
C064ID=#id[].*name*#
</iterate>
</dynamic>

On Jan 3, 2008 1:46 PM, Ashish Kulkarni <as...@gmail.com> wrote:

> Hi
> I have a class like below with get and set method
> public ColorClass
> {
> private String name, desc;
>
> public void setName(String _name)
> {
> this.name = _name;
> }
> public String getName()
> {
> return name;
> }
>
> }
>
> How can i define this ColorClass in parameterMap and use it in SQL
> statement for varaible substituation.
> <parameterMap mymap" class="java.util.Map">
>      <parameter property="id" javaType=" java.util.List" />
> </parameterMap>
> where id is list of ColorClass,
>
> I have a SQL statement as below
>
> select name, id from mytable
>
> <dynamic prepend="where">
> <iterate prepend="AND" property="id" open="("
> close=")" conjunction="OR">
> C064ID=#id[]#
> </iterate>
> </dynamic>
>
> I want to use getName method to get name of the colorclass,
>
>