ibatis中iterate的使用问题

悬赏:5 发布时间:2008-07-25 提问人:yangyu0227 (初级程序员)

如果我定义了个对象List,能循环得到List中对象的属性吗?



已解决,只要点属性就可以了,如下。
<isNotEmpty property="regionList" prepend="and">
RE_REGION_ID in
<iterate property="regionList" open="(" close=")" conjunction=",">
#regionList[].regionCode#
</iterate>
</isNotEmpty>
该问题已经关闭: <isNotEmpty property="regionList" prepend="and"> RE_REGION_ID in <iterate property="regionList" open="(" close=")" conjunction=","> #regionList[].regionCode# </iterate> </isNotEmpty>

回答

可以
比如这样写
<iterate property="map_sav_attr_list" open="" close="" conjunction=","> 
#map_sav_attr_list[].MAP_SAV_VAL#
</iterate>

IBATIS必须是2.1.6以上的版本才行
congjl2002 (资深程序员) 2008-07-25