I develop web application using Spring and iBatis. I want to insert multiple data in a table. I throw DataMap including ArrayList in controller as follow.
param.put("aList", aList);
param.put("aaaSeq", aaaSeq);
commonDAO.insert(namespace, "insertAAA", param);
In ibatis,
<insert id="insertAAA" parameterClass="dmap">
<selectKey keyProperty="aaaSeq" resultClass="java.lang.Integer" type="pre">
SELECT a_seq.nextval FROM DUAL
</selectKey>
insert into AAA
(
aSeq,
a,
)
<iterate property="aList" open="(" close=")" conjunction=" union all ">
select
#aaaSeq#,
#aList[]#
from
dual
</iterate>
</insert>
However, it have an error related with Integrity Constraints.
So, I wondering how to insert multiple data in a single table.