ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Warren <war...@clarksnutrition.com>
Subject Re: Question on using queryForObject(statementName, parameterObject, resultObject);
Date Sun, 29 Jul 2007 19:22:28 GMT
What happens when the statement returns no records? Does the item result 
Object get returned without the tax.description field set?

ARAI Hiroyuki wrote:
> Hi, Warren
> 
> At first, you have to set resultClass/resultMap attribute in select element.
> 
> Then, when you want to use nested JavaBean(i.e. tax object in item),
> you have to use ResultMap.
> 
> for example:
> 
> <resultMap id="itemMap" class="com.example.Item">
>   <result property="tax.description" column="TAX_NAME" />
> </resultMap>
> 
> <select id="getItemTax" parameterClass="item" resultMap="itemMap">
>    SELECT TAX_Name FROM ...
> </select>
> 
> thanks,
> 


-- 
Thanks,

Warren Bell
Systems Administrator
Clark's Nutritional Centers
4225 Market St.
Riverside, CA 92501
951-321-1960 ext. 142
909-645-8864 mobile

Mime
View raw message