Package org.apache.cayenne.query

# Class IteratedQueryDecorator

java.lang.Object
org.apache.cayenne.query.IteratedQueryDecorator

All Implemented Interfaces:
  `Serializable`, `Query`

public class IteratedQueryDecorator extends Object implements Query
A simple decorator for an iterated query.

Since:
  5.0
See Also:
  - `DataContext.iterator(Select)`
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `IteratedQueryDecorator(Query query, boolean fetchDataRows)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `SQLAction`
  `createSQLAction(SQLActionVisitor visitor)`
  A callback method invoked by Cayenne during the final execution phase of the query run.
  `QueryMetadata`
  `getMetaData(EntityResolver resolver)`
  Returns query runtime parameters.
  `Query`
  `getQuery()`
  `boolean`
  `isFetchingDataRows()`
  `void`
  `route(QueryRouter router, EntityResolver resolver, Query substitutedQuery)`
  A callback method invoked by Cayenne during the routing phase of the query execution.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### IteratedQueryDecorator

    public IteratedQueryDecorator(Query query, boolean fetchDataRows)

- ## Method Details

  - ### getMetaData

    public QueryMetadata getMetaData(EntityResolver resolver)
    Description copied from interface: `Query`
    Returns query runtime parameters. The method is called at various stages of the execution by Cayenne access stack to retrieve query parameters. EntityResolver instance is passed to this method, meaning that the query doesn't need to store direct references to Cayenne mapping objects and can resolve them at runtime.
    Specified by:
      `getMetaData` in interface `Query`

  - ### route

    public void route(QueryRouter router, EntityResolver resolver, Query substitutedQuery)
    Description copied from interface: `Query`
    A callback method invoked by Cayenne during the routing phase of the query execution. Mapping of DataNodes is provided by QueryRouter. Query should use a `QueryRouter.route(QueryEngine, Query, Query)` callback method to route itself. Query can create one or more substitute queries or even provide its own QueryEngine to execute itself.
    Specified by:
      `route` in interface `Query`

  - ### createSQLAction

    public SQLAction createSQLAction(SQLActionVisitor visitor)
    Description copied from interface: `Query`
    A callback method invoked by Cayenne during the final execution phase of the query run. A concrete query implementation is given a chance to decide how it should be handled. Implementors can pick an appropriate method of the SQLActionVisitor to handle itself, create a custom SQLAction of its own, or substitute itself with another query that should be used for SQLAction construction.
    Specified by:
      `createSQLAction` in interface `Query`

  - ### getQuery

    public Query getQuery()

  - ### isFetchingDataRows

    public boolean isFetchingDataRows()