mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-20 10:07:17 +00:00
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:
parent
e8f2f79236
commit
3c2db8f78d
@ -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 -
|
Soft delete support is defined by 3 main parts -
|
||||||
|
|
||||||
1. The <<soft-delete-column,column>> which contains the indicator.
|
1. A <<soft-delete-type,strategy>> for interpreting the stored indicator values.
|
||||||
2. A <<soft-delete-conversion,conversion>> from `Boolean` indicator value to the proper database type
|
2. The <<soft-delete-column,column>> which contains the indicator.
|
||||||
3. A <<soft-delete-type,strategy>> for interpreting the stored indicator values.
|
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]]
|
[[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.
|
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.
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user