File tree Expand file tree Collapse file tree
hibernate-core/src/main/java/org/hibernate/annotations Expand file tree Collapse file tree Original file line number Diff line number Diff line change 116116 Class <? extends AttributeConverter <Boolean ,?>> converter () default UnspecifiedConversion .class ;
117117
118118 /**
119- * Used as the default for {@linkplain SoftDelete#converter() }, indicating that
119+ * Used as the default for {@linkplain SoftDelete#converter}, indicating that
120120 * {@linkplain Dialect#getPreferredSqlTypeCodeForBoolean() dialect} and
121121 * {@linkplain org.hibernate.cfg.MappingSettings#PREFERRED_BOOLEAN_JDBC_TYPE settings}
122122 * resolution should be used.
Original file line number Diff line number Diff line change 44 */
55package org .hibernate .annotations ;
66
7- import java .util .Locale ;
8-
97/**
108 * Enumeration of defines styles of soft-delete
119 *
@@ -42,19 +40,16 @@ public enum SoftDeleteType {
4240 * <dd>indicates that the row is deleted, at the given timestamp</dd>
4341 * </dl>
4442 */
45- TIMESTAMP ( "deleted" );
46-
47- private final String defaultColumnName ;
48-
49- SoftDeleteType () {
50- this .defaultColumnName = name ().toLowerCase ( Locale .ROOT );
51- }
52-
53- SoftDeleteType (String defaultColumnName ) {
54- this .defaultColumnName = defaultColumnName ;
55- }
43+ TIMESTAMP ;
5644
45+ /**
46+ * The default column name used with this strategy.
47+ * @see SoftDelete#columnName
48+ */
5749 public String getDefaultColumnName () {
58- return defaultColumnName ;
50+ return switch ( this ) {
51+ case ACTIVE -> "active" ;
52+ case DELETED , TIMESTAMP -> "deleted" ;
53+ };
5954 }
6055}
You can’t perform that action at this time.
0 commit comments