HHH-17164 - Proper, first-class soft-delete support

HHH-17311 - Reversed soft delete support

https://hibernate.atlassian.net/browse/HHH-17164
https://hibernate.atlassian.net/browse/HHH-17311
This commit is contained in:
Steve Ebersole 2023-10-26 10:37:37 -05:00
parent e8f2f79236
commit 3c2db8f78d
1 changed files with 18 additions and 17 deletions

View File

@ -21,9 +21,24 @@ Hibernate supports soft delete for both <<soft-delete-entity,entities>> and <<so
Soft delete support is defined by 3 main parts -
1. The <<soft-delete-column,column>> which contains the indicator.
2. A <<soft-delete-conversion,conversion>> from `Boolean` indicator value to the proper database type
3. A <<soft-delete-type,strategy>> for interpreting the stored indicator values.
1. A <<soft-delete-type,strategy>> for interpreting the stored indicator values.
2. The <<soft-delete-column,column>> which contains the indicator.
3. A <<soft-delete-conversion,conversion>> from `Boolean` indicator value to the proper database type
[[soft-delete-type]]
==== Strategy - SoftDeleteType
Given truth values, there are 2 valid ways to interpret the values stored in the database. This
interpretation is defined by the SoftDeleteType enumeration and can be configured per-usage using
`@SoftDelete(..., strategy=ACTIVE)` or `@SoftDelete(..., strategy=DELETED)` -
ACTIVE::
Tracks rows which are active. A `true` value in the database indicates that the row is active
(non-deleted); a `false` value indicates inactive (deleted).
DELETED::
Tracks rows which are deleted. A `true` value in the database indicates that the row is deleted;
a `false` value indicates that the row is non-deleted.
[[soft-delete-column]]
@ -139,17 +154,3 @@ The `@SoftDelete` annotation may also be placed at the package level, in which c
entities and collections defined within the package.
[[soft-delete-type]]
==== Strategy - SoftDeleteType
Given truth values, there are 2 valid ways to interpret the values stored in the database. This
interpretation is defined by the SoftDeleteType enumeration and can be configured per-usage using
`@SoftDelete(..., strategy=ACTIVE)` or `@SoftDelete(..., strategy=DELETED)` -
ACTIVE::
Tracks rows which are active. A `true` value in the database indicates that the row is active
(non-deleted); a `false` value indicates inactive (deleted).
DELETED::
Tracks rows which are deleted. A `true` value in the database indicates that the row is deleted;
a `false` value indicates that the row is non-deleted.