public final class PostLoadContext
extends java.lang.Object
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, 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 getElements()
will only return a List
containing a single Entity. This is
due to the streaming nature of query responses.Modifier and Type | Method and Description |
---|---|
T |
getCurrentElement() |
int |
getCurrentIndex() |
Transaction |
getCurrentTransaction() |
java.util.List<T> |
getElements() |
java.lang.String |
toString() |
public java.util.List<T> getElements()
getElements
in interface CallbackContext<T>
public Transaction getCurrentTransaction()
getCurrentTransaction
in interface CallbackContext<T>
null
if there is no current transaction.public int getCurrentIndex()
getCurrentIndex
in interface CallbackContext<T>
CallbackContext.getElements()
of the element for which the callback
has been invoked.public T getCurrentElement()
getCurrentElement
in interface CallbackContext<T>
getElements().getCurrentIndex()
.public java.lang.String toString()
toString
in class java.lang.Object