Spring JpaRepostory delete vs deleteInBatch

后端 未结 3 687
你的背包
你的背包 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:45

    The delete method is going to delete your entity in one operation. The deleteInBatch is going to batch several delete-statements and delete them as 1 operation.

    If you need a lot of delete operations the batch-deletion might be faster.

提交回复
热议问题