Skip to content

Commit e76e53f

Browse files
Batch deletes (orphanRemoval = true)
1 parent bac73ab commit e76e53f

File tree

1 file changed

+1
-1
lines changed
  • HibernateSpringBootBatchDeleteOrphanRemoval

1 file changed

+1
-1
lines changed

HibernateSpringBootBatchDeleteOrphanRemoval/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- in this example, we have a `Author` entity and each author can have several `Book` (*one-to-many*)\
99
- first, we use `orphanRemoval=true` and `CascadeType.ALL`\
1010
- second, we dissociate all `Book` from the corresponding `Author`\
11-
- third, we explicitly (manually) flush the persistent context; is time for `orphanRemoval=true` to enter into the scene; thanks to this setting, all disassociated books will be deleted; the generated `DELETE` statements are batched (if `orphanRemoval` is set to `false`, a bunch of updates will be executed instead of deletes\
11+
- third, we explicitly (manually) flush the persistent context; is time for `orphanRemoval=true` to enter into the scene; thanks to this setting, all disassociated books will be deleted; the generated `DELETE` statements are batched (if `orphanRemoval` is set to `false`, a bunch of updates will be executed instead of deletes)\
1212
- forth, we delete all `Author` via the `deleteAll()` or `delete()` method (since we have dissaciated all `Book`, the `Author` deletion will take advantage of batching as well)
1313

1414
-------------------------------

0 commit comments

Comments
 (0)