intermediate~3h
Soft Deletes — @SQLDelete, @SQLRestriction/@Where
Hibernate's dedicated soft-delete annotations move the pattern from something every developer must remember per query into something the ORM enforces automatically, everywhere, by default.
Learning objectives
- Implement soft delete using @SQLDelete and @SQLRestriction/@Where together.
- Explain why using only one of the two annotations leaves a real gap in the pattern.
- Build a deliberate escape hatch for viewing soft-deleted rows when genuinely needed.
This is a Pro chapter
Sign in, then upgrade to Pro or Power to unlock this and the full Spring Ecosystem Mastery library.
Soft Deletes — @SQLDelete, @SQLRestriction/@Where