mybatis mapによる一括更新(Oracle)
永続レイヤインタフェースの方法:
マッピングファイルの以下の3つの書き方はすべて可能で、注意";"の使用:
ちなみに、mysqlで同様の複数の文を実行するには、データベース接続構成&allowMultiQueries=true jdbc:mysql://localhost:3306/mydb?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
void batchUpdateLogistics(@Param("callMap") Map callMap);
マッピングファイルの以下の3つの書き方はすべて可能で、注意";"の使用:
update TD_LOGISTICS t set t.record=#{value} where t.sessionId=#{key}
update TD_LOGISTICS t set t.record=#{value} where t.sessionId=#{key};
begin
update TD_LOGISTICS t set t.record=#{value} where t.sessionId=#{key};
end;
ちなみに、mysqlで同様の複数の文を実行するには、データベース接続構成&allowMultiQueries=true jdbc:mysql://localhost:3306/mydb?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true