OperationObserver (cayenne-doc: Cayenne Documentation 5.0-M2 API)
Description: declaration: package: org.apache.cayenne.access, interface: OperationObserver

# Interface OperationObserver

All Superinterfaces:
  `OperationHints`

All Known Implementing Classes:
  `DefaultOperationObserver, DoNothingOperationObserver, IteratedSelectObserver`

public interface OperationObserver extends OperationHints
Defines a set of callback methods that allow `DataNode` to pass back query results and notify caller about exceptions.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `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)`
  Callback method invoked after each batch of generated values is read during an update.
  `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 q, ResultIterator<?> it)`
  Callback method invoked for each opened ResultIterator.

  ### Methods inherited from interface OperationHints

  `isIteratedResult`
  Modifier and Type
  Method
  Description
  `boolean`
  `isIteratedResult()`
  Returns `true` to indicate that any results of a select operation should be returned as a ResultIterator.

- ## Method Details

  - ### nextCount

    void nextCount(Query query, int resultCount)
    Callback method invoked after an updating query is executed.

  - ### nextBatchCount

    void nextBatchCount(Query query, int[] resultCount)
    Callback method invoked after a batch update is executed.

  - ### nextRows

    void nextRows(Query query, List<?> dataRows)
    Callback method invoked for each processed ResultSet.
    Since:
      3.0

  - ### nextRows

    void nextRows(Query q, ResultIterator<?> it)
    Callback method invoked for each opened ResultIterator. If this observer requested results to be returned as a ResultIterator, this method is invoked instead of `nextRows(Query, List)`.
    Since:
      3.0

  - ### nextGeneratedRows

    void nextGeneratedRows(Query query, ResultIterator<?> keys, List<ObjectId> idsToUpdate)
    Callback method invoked after each batch of generated values is read during an update.
    Since:
      4.2

  - ### nextQueryException

    void nextQueryException(Query query, Exception ex)
    Callback method invoked on exceptions that happen during an execution of a specific query.

  - ### nextGlobalException

    void nextGlobalException(Exception ex)
    Callback method invoked on exceptions that are not tied to a specific query execution, such as JDBC connection exceptions, etc.