Stay organized with collections
Save and categorize content based on your preferences.
publicinterfacePostDeleteimplementsAnnotation
Identifies a callback method to be invoked after an Entity of any of the specified kinds
is deleted from the datastore. If #kinds() is not provided the callback will execute for
all kinds. Methods with this annotation must return void, must accept a single argument
of type DeleteContext, must not throw any checked exceptions, must not be static, and
must belong to a class with a no-arg constructor. Neither the method nor the no-arg constructor
of the class to which it belongs are required to be public. Methods with this annotation are free
to throw any unchecked exception they like. Throwing an unchecked exception will prevent
callbacks that have not yet been executed from running, and the exception will propagate to the
code that invoked the datastore operation that resulted in the invocation of the callback.
Throwing an unchecked exception from a callback will not have any impact on the result of
the datastore operation. Methods with this annotation will not be invoked if the datastore
operation fails.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-03 UTC."],[[["\u003cp\u003e\u003ccode\u003ePostDelete\u003c/code\u003e is an annotation that identifies a callback method to be invoked after an Entity is deleted from the datastore.\u003c/p\u003e\n"],["\u003cp\u003eThe callback method, annotated with \u003ccode\u003ePostDelete\u003c/code\u003e, must return \u003ccode\u003evoid\u003c/code\u003e, accept a single \u003ccode\u003eDeleteContext\u003c/code\u003e argument, not throw checked exceptions, not be static, and belong to a class with a no-arg constructor.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ekinds()\u003c/code\u003e method within \u003ccode\u003ePostDelete\u003c/code\u003e specifies the Entity kinds the callback applies to, with an empty array indicating all kinds.\u003c/p\u003e\n"],["\u003cp\u003eUnchecked exceptions thrown from the callback will prevent subsequent callbacks from executing but will not affect the result of the datastore operation, and the datastore operation must be successful for the callback method to be invoked.\u003c/p\u003e\n"]]],[],null,["# Annotation Type PostDelete (2.0.0)\n\n public interface PostDelete implements Annotation\n\nIdentifies a callback method to be invoked after an [Entity](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Entity) of any of the specified kinds\nis deleted from the datastore. If [#kinds()](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.PostDelete#com_google_appengine_api_datastore_PostDelete_kinds__) is not provided the callback will execute for\nall kinds. Methods with this annotation must return `void`, must accept a single argument\nof type [DeleteContext](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.DeleteContext), must not throw any checked exceptions, must not be static, and\nmust belong to a class with a no-arg constructor. Neither the method nor the no-arg constructor\nof the class to which it belongs are required to be public. Methods with this annotation are free\nto throw any unchecked exception they like. Throwing an unchecked exception will prevent\ncallbacks that have not yet been executed from running, and the exception will propagate to the\ncode that invoked the datastore operation that resulted in the invocation of the callback.\nThrowing an unchecked exception from a callback will **not** have any impact on the result of\nthe datastore operation. Methods with this annotation will not be invoked if the datastore\noperation fails. \n\nImplements\n----------\n\n[Annotation](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html)\n\nMethods\n-------\n\n### kinds()\n\n public abstract String[] kinds()\n\nThe kinds to which this callback applies. The default value is an empty array, which indicates\nthat the callback should run for all kinds."]]