Annotation Interface SQLDelete
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.
When the affected table has a tenant id column outside
the primary key, the statement may declare one additional JDBC parameter,
after all the usual parameters, for the session tenant id.
The additional tenant parameter is bound to null for a
root tenant,
so that, for example, the custom SQL may end with and tenant_id=coalesce(?,tenant_id).
Hibernate executes the custom SQL as written and does not add a tenant predicate.
A tenant id that belongs to the primary key retains its usual primary key parameter.
If an entity has secondary
tables, it may have a @SQLDelete annotation for each secondary table.
The table() member must specify the name of the secondary table.
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanIs the statement callable (aka aCallableStatement)?Deprecated, for removal: This API element is subject to removal in a future version.The name of the table affected by the delete statement.Class<? extends Expectation> AnExpectationclass used to verify that the operation was successful.
-
Element Details
-
sql
String sqlProcedure name or SQLDELETEstatement. -
callable
-
verify
Class<? extends Expectation> verifyAnExpectationclass used to verify that the operation was successful.- See Also:
- Default:
org.hibernate.jdbc.Expectation.class
-
check
Deprecated, for removal: This API element is subject to removal in a future version.useverify()with anExpectationclassAResultCheckStyleused to verify that the operation was successful.- Default:
NONE
-
table
String tableThe 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:
""
-
verify()with anExpectationclass