mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
As noted in comments in #2952 In the internals of SaveManyBeans we have: - BUG: the deleteByParentId is hard delete and does not care for soft delete - YUK: internally we have 3 ways of performing the orphan removal when we really want 2 This change fixes the BUG and fixes the YUK. It does this by removing the special case at: https://github.com/ebean-orm/ebean/blob/ebean-parent-13.11.3/ebean-core/src/main/java/io/ebeaninternal/server/persist/SaveManyBeans.java#L347-L350 ... and replacing it with the more common orphan removal code used when we do not have BeanCollection modifications. The result of this change is that in SaveManyBeans internals we get back to have 2 ways to remove orphans. - A BeanCollection with modifications: Orphans explicitly deleted using the known elements removed from the collection - All other cases: Orphans as everything NOT in the collection that is going to be updated