ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anika agarwal <scarlet_...@yahoo.co.in>
Subject Re: question about parameterMap and java class
Date Fri, 04 Jan 2008 03:32:45 GMT
Hi why dont you use result map to getName of the color class.. like...

<typeAlias alias="colorClass" type="ColorClass" />
<resultMap id="colorClass" class="colorClass">
<result property="name" column="name" />
</resultMap>


<select id="getNameOfColorClass" timeout="800" parameterClass="colorClass" resultMap="colorClass"
>

select name, id from mytable 

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

So in you class u can get the name of the color class by doing colorClass.getname();

Hope this will help you....
----- Original Message ----
From: Ashish Kulkarni <ashish.kulkarni13@gmail.com>
To: user-java@ibatis.apache.org
Sent: Friday, 4 January, 2008 12:16:34 AM
Subject: 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,


      Now you can chat without downloading messenger. Go to http://in.messenger.yahoo.com/webmessengerpromo.php
Mime
View raw message