Package org.hibernate.annotations
Annotation Type SQLDelete
-
@Target({TYPE,FIELD,METHOD}) @Retention(RUNTIME) @Repeatable(SQLDeletes.class) public @interface SQLDelete
Specifies a custom SQL DML statement to be used in place of the default SQL generated by Hibernate when an entity or collection row is deleted from the database.The given SQL statement must have exactly the number of JDBC
?parameters that Hibernate expects, in the exact order Hibernate expects. The primary key columns come before the version column if the entity is versioned.If an entity has secondary tables, it may have a
@SQLDeleteannotation for each secondary table. Thetable()member must specify the name of the secondary table.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleancallableIs the statement callable (aka aCallableStatement)?ResultCheckStylecheckDeprecated.useverify()with anExpectationclassStringtableThe name of the table affected by the delete statement.Class<? extends Expectation>verifyAnExpectationclass used to verify that the operation was successful.
-
-
-
Element Detail
-
sql
String sql
Procedure name or SQLDELETEstatement.
-
-
-
callable
boolean callable
Is the statement callable (aka aCallableStatement)?- Default:
- false
-
-
-
verify
Class<? extends Expectation> verify
AnExpectationclass used to verify that the operation was successful.- Default:
- org.hibernate.jdbc.Expectation.class
-
-
-
check
@Deprecated(since="6.5") ResultCheckStyle check
Deprecated.useverify()with anExpectationclassAResultCheckStyleused to verify that the operation was successful.- Default:
- org.hibernate.annotations.ResultCheckStyle.NONE
-
-
-
table
String table
The name of the table affected by the delete statement. Required when the statement affects a secondary table of an entity. Not required for collections nor when the insert statement affects the primary table of an entity.- Returns:
- the name of the secondary table
- Since:
- 6.2
- Default:
- ""
-
-