Spring JpaRepostory delete vs deleteInBatch

后端 未结 3 707
你的背包
你的背包 2021-02-05 04:03

What is the difference between delete(...) and deleteInBatch(...) methods in JpaRepostory in Spring ? The second one \"deletes items in one SQL stateme

3条回答
  •  忘掉有多难
    2021-02-05 04:42

    deleteInBatch(...) in the log would look like this: DELETE FROM table_name WHERE (((((((? = id) OR (? = id)) OR (? = id)) OR (? = id)) OR (? = id)) OR (? = id)) OR (? = id))

    That might leads to a problem if there are a large amount of data to be deleted, which reaches maximum size of the SQL server query: Maximum size for a SQL Server Query? IN clause? Is there a Better Approach

提交回复
热议问题