public class DefaultOperationObserver extends Object implements OperationObserver
This operation observer is unsafe to use in application, since it doesn't rethrow the exceptions immediately, and may cause the database to hang.
| Modifier and Type | Field and Description |
|---|---|
protected List<Throwable> |
globalExceptions |
protected Map<Query,Throwable> |
queryExceptions |
| Constructor and Description |
|---|
DefaultOperationObserver() |
| Modifier and Type | Method and Description |
|---|---|
List<Throwable> |
getGlobalExceptions()
Returns a list of global exceptions that occured during data operation
run.
|
Map<Query,Throwable> |
getQueryExceptions()
Returns a list of exceptions that occured during data operation run by
query.
|
boolean |
hasExceptions()
Returns
true if at least one exception was registered during
query execution. |
boolean |
isIteratedResult()
Returns
false. |
void |
nextBatchCount(Query query,
int[] resultCount)
Callback method invoked after a batch update is executed.
|
void |
nextCount(Query query,
int resultCount)
Callback method invoked after an updating query is executed.
|
void |
nextGeneratedRows(Query query,
ResultIterator<?> keys,
List<ObjectId> idsToUpdate)
Closes ResultIterator without reading its data.
|
void |
nextGlobalException(Exception ex)
Callback method invoked on exceptions that are not tied to a specific query
execution, such as JDBC connection exceptions, etc.
|
void |
nextQueryException(Query query,
Exception ex)
Callback method invoked on exceptions that happen during an execution of a specific
query.
|
void |
nextRows(Query query,
List<?> dataRows)
Callback method invoked for each processed ResultSet.
|
void |
nextRows(Query query,
ResultIterator it)
Closes ResultIterator without reading its data.
|
void |
printExceptions(PrintWriter out)
Prints the information about query and global exceptions.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnextGeneratedRowspublic void printExceptions(PrintWriter out)
public List<Throwable> getGlobalExceptions()
public Map<Query,Throwable> getQueryExceptions()
public boolean hasExceptions()
true if at least one exception was registered during
query execution.public void nextCount(Query query, int resultCount)
OperationObservernextCount in interface OperationObserverpublic void nextBatchCount(Query query, int[] resultCount)
OperationObservernextBatchCount in interface OperationObserverpublic void nextRows(Query query, List<?> dataRows)
OperationObservernextRows in interface OperationObserverpublic void nextRows(Query query, ResultIterator it)
nextRows in interface OperationObserverpublic void nextGeneratedRows(Query query, ResultIterator<?> keys, List<ObjectId> idsToUpdate)
nextGeneratedRows in interface OperationObserverpublic void nextQueryException(Query query, Exception ex)
OperationObservernextQueryException in interface OperationObserverpublic void nextGlobalException(Exception ex)
OperationObservernextGlobalException in interface OperationObserverpublic boolean isIteratedResult()
false.isIteratedResult in interface OperationHintsCopyright © 2001–2020 Apache Cayenne. All rights reserved.