Skip to content

Commit 3c2db8f

Browse files
committed
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
1 parent e8f2f79 commit 3c2db8f

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

documentation/src/main/asciidoc/userguide/chapters/domain/soft_delete.adoc

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,24 @@ Hibernate supports soft delete for both <<soft-delete-entity,entities>> and <<so
2121

2222
Soft delete support is defined by 3 main parts -
2323

24-
1. The <<soft-delete-column,column>> which contains the indicator.
25-
2. A <<soft-delete-conversion,conversion>> from `Boolean` indicator value to the proper database type
26-
3. A <<soft-delete-type,strategy>> for interpreting the stored indicator values.
24+
1. A <<soft-delete-type,strategy>> for interpreting the stored indicator values.
25+
2. The <<soft-delete-column,column>> which contains the indicator.
26+
3. A <<soft-delete-conversion,conversion>> from `Boolean` indicator value to the proper database type
27+
28+
29+
[[soft-delete-type]]
30+
==== Strategy - SoftDeleteType
31+
32+
Given truth values, there are 2 valid ways to interpret the values stored in the database. This
33+
interpretation is defined by the SoftDeleteType enumeration and can be configured per-usage using
34+
`@SoftDelete(..., strategy=ACTIVE)` or `@SoftDelete(..., strategy=DELETED)` -
35+
36+
ACTIVE::
37+
Tracks rows which are active. A `true` value in the database indicates that the row is active
38+
(non-deleted); a `false` value indicates inactive (deleted).
39+
DELETED::
40+
Tracks rows which are deleted. A `true` value in the database indicates that the row is deleted;
41+
a `false` value indicates that the row is non-deleted.
2742

2843

2944
[[soft-delete-column]]
@@ -139,17 +154,3 @@ The `@SoftDelete` annotation may also be placed at the package level, in which c
139154
entities and collections defined within the package.
140155

141156

142-
[[soft-delete-type]]
143-
==== Strategy - SoftDeleteType
144-
145-
Given truth values, there are 2 valid ways to interpret the values stored in the database. This
146-
interpretation is defined by the SoftDeleteType enumeration and can be configured per-usage using
147-
`@SoftDelete(..., strategy=ACTIVE)` or `@SoftDelete(..., strategy=DELETED)` -
148-
149-
ACTIVE::
150-
Tracks rows which are active. A `true` value in the database indicates that the row is active
151-
(non-deleted); a `false` value indicates inactive (deleted).
152-
DELETED::
153-
Tracks rows which are deleted. A `true` value in the database indicates that the row is deleted;
154-
a `false` value indicates that the row is non-deleted.
155-

0 commit comments

Comments
 (0)