intermediateSoft Deletes — @SQLDelete, @SQLRestriction/@Where
Does @SQLRestriction's automatic filter apply to a native query you write yourself?
No — the automatic filter only applies to Hibernate-generated SQL (derived queries, JPQL). A raw native query bypasses it entirely and needs its own explicit exclusion condition if soft-deleted rows shouldn't appear in that query's results.
This is a Pro chapter
Sign in, then upgrade to Pro or Power to unlock this and the full Spring Ecosystem Mastery library.
Does @SQLRestriction's automatic filter apply to a native query you write yourself?