mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-22 15:10:02 +00:00
#2948 - SoftDelete entities are hard deleted on orphan removal
This commit is contained in:
1 parent
b25233b0b9
commit
09001e80b5
2 files changed
+5
-2
No files matched your search
@@ -861,7 +861,7 @@ public final class DefaultPersister implements Persister {
|
|||||||
SpiTransaction t = request.transaction();
|
SpiTransaction t = request.transaction();
|
||||||
EntityBean orphanForRemoval = request.importedOrphanForRemoval();
|
EntityBean orphanForRemoval = request.importedOrphanForRemoval();
|
||||||
if (orphanForRemoval != null) {
|
if (orphanForRemoval != null) {
|
||||||
delete(orphanForRemoval, request.transaction(), true);
|
delete(orphanForRemoval, request.transaction(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// exported ones with cascade save
|
// exported ones with cascade save
|
||||||
|
|||||||
@@ -34,7 +34,10 @@ public class StatefulO2MSoftDelete extends BaseTestCase {
|
|||||||
|
|
||||||
DB.update(goodsFromDB);
|
DB.update(goodsFromDB);
|
||||||
var updateSql = LoggedSql.stop();
|
var updateSql = LoggedSql.stop();
|
||||||
updateSql.forEach(System.out::println);
|
|
||||||
updateSql.forEach(sql -> assertThat(sql).doesNotContain("delete from workflow_entity"));
|
updateSql.forEach(sql -> assertThat(sql).doesNotContain("delete from workflow_entity"));
|
||||||
|
if (isH2()) {
|
||||||
|
assertThat(updateSql.get(4)).contains("update workflow_operation_entity set deleted=true where workflow_id = ?");
|
||||||
|
assertThat(updateSql.get(6)).contains("update workflow_entity set when_modified=?, deleted=? where id=?");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user