ITeye博客

ibatis通用持久层

jqs1124 · 2012-02-21 09:44 · ibatis 通用 持久 · Markdown

<insert id="customPO_insert" parameterClass="customPO">
INSERT INTO $moduleTable$ (parentID
<iterate property="fieldValueList" prepend="," conjunction=",">
$fieldValueList[].key$
</iterate>
)
VALUES (#parentID#
<iterate property="fieldValueList" prepend="," conjunction=",">
#fieldValueList[].value#
</iterate>
)
<selectKey resultClass="int" keyProperty="id">
SELECT last_insert_id()
</selectKey>
</insert>

如果用到网上写的通用持久层例子的朋友,一定一定要注意:fieldValueList[].key,fieldValueList[].value---》不是Map中的key和value,而是自己定义的一个对象中的两个属性key和value。

 

这个问题花了我两天的时间啊,杯具···

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。