Top Description Inners Methods
org.hibernate.annotations

public @Interface SoftDelete

extends Annotation
Annotations
@Target:PACKAGE, TYPE, FIELD, METHOD, ANNOTATION_TYPE
@Retention:RUNTIME
@Documented
@Incubating
Imports
java.lang.annotation.Documented, .ElementType, .Retention, .Target, org.hibernate.Incubating, org.hibernate.dialect.Dialect, jakarta.persistence.AttributeConverter

Describes a soft-delete indicator mapping.

Soft deletes handle "deletions" from a database table by setting a column in the table to indicate deletion.

May be defined at various levels

Author
Steve Ebersole
Since
6.4

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
SoftDelete.UnspecifiedConversion

Used as the default for SoftDelete#converter(), indicating that dialect and settings resolution should be used.

Method Summary

Modifier and TypeMethod and Description
public String
columnName()

(Optional) The name of the column.

public Class<? extends AttributeConverter<Boolean, ?>>
converter()

(Optional) Conversion to apply to determine the appropriate value to store in the database.

public SoftDeleteType
strategy()

The strategy to use for storing/reading values to/from the database.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

columnNameback to summary
public String columnName()

(Optional) The name of the column.

Default depends on the strategy being used.

See Also
SoftDeleteType#getDefaultColumnName()
converterback to summary
public Class<? extends AttributeConverter<Boolean, ?>> converter()

(Optional) Conversion to apply to determine the appropriate value to store in the database. The "domain representation" can be:

true
Indicates that the row is considered deleted
false
Indicates that the row is considered NOT deleted

By default, values are stored as booleans in the database according to the dialect and settings

API Note

The converter should never return null

strategyback to summary
public SoftDeleteType strategy()

The strategy to use for storing/reading values to/from the database.

The strategy also affects the default column name.

org.hibernate.annotations back to summary

public Interface SoftDelete.UnspecifiedConversion

extends AttributeConverter<Boolean, Object>

Used as the default for SoftDelete#converter(), indicating that dialect and settings resolution should be used.

Method Summary

Inherited from jakarta.persistence.AttributeConverter:
convertToDatabaseColumnconvertToEntityAttribute