Soft delete

Deleting a record without removing it — flagging the row, recording who deleted it and when, and keeping it out of reads. The question underneath is what DELETE should mean to a client that cannot tell the difference, and what happens to a composition tree when its root is flagged.

Overview

SAP SHIPS

No core answer is documented.

Not covered: DELETE removes rows. Deleting a composition root cascades a physical delete down the hierarchy, and change tracking has to be told with @cascade:{delete} whether changelog entries should follow — a question that only arises because the record itself is gone. Retention under data privacy is about erasing sooner, not about keeping. Nothing in the core turns a delete into a flag.

Assessed by searching capire for soft or logical delete and finding no guidance — a assessment resting on the absence of a source rather than on one. If the core does answer this somewhere, this state is wrong and should be corrected.

THE COMMUNITY ADDS

Two implementations, one per runtime, from the same author: an aspect adding isDeleted, deletedAt and deletedBy, an annotation opting a service projection in, and handlers that rewrite DELETE as an update and filter flagged rows out of READ.

Artifacts2

2 of 2 artifacts
ArtifactSignals
CDS plugins2
cds-feature-softdeleteCAP Java plugin for soft delete with a softdelete aspect
Signals
No license+1
cds-softdelete-pluginCAP plugin turning DELETE into a flag on annotated entities
Signals
Functional boundary

Details

Coverage
statecommunity only, CAP
assessed
For your agent