public final class PreQueryContext
extends java.lang.Object
CallbackContext implementation that is specific to intercepted queries. Methods
annotated with PreQuery that receive instances of this class may modify the Query
returned by calling getCurrentElement(). This is an effective way to modify queries
prior to execution.| Modifier and Type | Method and Description |
|---|---|
T |
getCurrentElement()
Returns the element for which the callback has been invoked.
|
int |
getCurrentIndex()
Returns the index in the result of
CallbackContext.getElements() of the element for which the callback
has been invoked. |
Transaction |
getCurrentTransaction()
Returns the current transaction, or
null if there is no current transaction. |
java.util.List<T> |
getElements()
Returns an unmodifiable view of the elements involved in the operation that triggered the
callback..
|
java.lang.String |
toString() |
public java.util.List<T> getElements()
CallbackContextgetElements in interface CallbackContext<T>public Transaction getCurrentTransaction()
CallbackContextnull if there is no current transaction.getCurrentTransaction in interface CallbackContext<T>public int getCurrentIndex()
CallbackContextCallbackContext.getElements() of the element for which the callback
has been invoked.getCurrentIndex in interface CallbackContext<T>public T getCurrentElement()
CallbackContextgetElements().getCurrentIndex().getCurrentElement in interface CallbackContext<T>public java.lang.String toString()
toString in class java.lang.Object