Top Description Methods
org.hibernate.annotations

public @Interface OnDelete

extends Annotation
Annotations
@Target:METHOD, FIELD, TYPE
@Retention:RUNTIME
Imports
java.lang.annotation.Retention, .Target

Specifies an on delete action for a foreign key constraint. The most common usage is @OnDelete(action = CASCADE). Note that this results in an on delete cascade clause in the DDL definition of the foreign key. It's completely different to jakarta.persistence.CascadeType#REMOVE.

Like database triggers, on delete actions can cause state held in memory to lose synchronization with the database.

Author
Emmanuel Bernard

Method Summary

Modifier and TypeMethod and Description
public OnDeleteAction
action()

The action to taken by the database when deletion of a row would cause the constraint to be violated.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

actionback to summary
public OnDeleteAction action()

The action to taken by the database when deletion of a row would cause the constraint to be violated.