mybatis を使用すると、各バッチドライバーを使用して複数の行を削除できます。これを使用するには、マッパー XML ファイルで <foreach> を使用する必要があります。以下に例を示します。
<delete id="batchDeleteAccountById" parameterType="java.util.List">
delete from ACCOUNT
where
ACC_ID in
<foreach item="AccountID" collection="list" open="(" close=")" separator=",">
#{AccountID}
</foreach>
</delete>
<delete id="batchDeleteAccountById" parameterType="java.util.List">
delete from ACCOUNT
where
ACC_ID in
<foreach item="AccountID" collection="list" open="(" close=")" separator=",">
#{AccountID}
</foreach>
</delete>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
次に、以下のように Camel メッセージを DeleteList ステートメントタイプを使用する mybatis エンドポイントに送信することで、複数の行を削除できます。
from("direct:start")
.to("mybatis:batchDeleteAccount?statementType=DeleteList")
.to("mock:result");
from("direct:start")
.to("mybatis:batchDeleteAccount?statementType=DeleteList")
.to("mock:result");
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow