Annotation Interface OnDelete
Notifications are delivered in the same thread that deletes the object, before the delete actually occurs. At most one delete notification will ever be delivered for any object deletion event.
The annotated method must be an instance method (i.e., not static), return void, and take zero parameters.
It may have any level of access, including private
.
Some notifications may need to be ignored by objects in detached transactions;
you can use this.isDetached()
to detect that situation.
Actions that have effects visible to the outside world should be made contingent on successful transaction commit,
for example, via Transaction.addCallback()
.
Meta-Annotations
This annotation may be configured indirectly as a Spring
meta-annotation
when spring-core
is on the classpath.