Class PostLoadContext
java.lang.Object
com.google.appengine.api.datastore.PostLoadContext
- All Implemented Interfaces:
CallbackContext<Entity>
Concrete
CallbackContext implementation that is specific to intercepted operations that
load Entities, currently get and "query". It is important to note that when a
PostLoadContext is provided to a callback following a get operation, CallbackContext.getElements()
returns all retrieved Entities. However, when a PostLoadContext is provided to a callback
following a query, a separate PostLoadContext will be constructed for each Entity in the result
set so CallbackContext.getElements() will only return a List containing a single Entity. This is
due to the streaming nature of query responses.-
Method Summary
Modifier and TypeMethodDescriptionReturns the element for which the callback has been invoked.intReturns the index in the result ofCallbackContext.getElements()of the element for which the callback has been invoked.Returns the current transaction, ornullif there is no current transaction.Returns an unmodifiable view of the elements involved in the operation that triggered the callback..toString()
-
Method Details
-
getElements
Description copied from interface:CallbackContextReturns an unmodifiable view of the elements involved in the operation that triggered the callback..- Specified by:
getElementsin interfaceCallbackContext<T>
-
getCurrentTransaction
Description copied from interface:CallbackContextReturns the current transaction, ornullif there is no current transaction.- Specified by:
getCurrentTransactionin interfaceCallbackContext<T>
-
getCurrentIndex
public int getCurrentIndex()Description copied from interface:CallbackContextReturns the index in the result ofCallbackContext.getElements()of the element for which the callback has been invoked.- Specified by:
getCurrentIndexin interfaceCallbackContext<T>
-
getCurrentElement
Description copied from interface:CallbackContextReturns the element for which the callback has been invoked. Shortcut forgetElements().getCurrentIndex().- Specified by:
getCurrentElementin interfaceCallbackContext<T>
-
toString
-