Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.query
Interface Query

All Superinterfaces:
  java.io.Serializable

All Known Subinterfaces:
  GenericSelectQuery, ParameterizedQuery

All Known Implementing Classes:
  AbstractQuery, BatchQuery, DeleteBatchQuery, DeleteQuery, EOQuery, EOSQLQuery, IndirectQuery, InsertBatchQuery, InsertQuery, NamedQuery, ObjectIdQuery, PrefetchSelectQuery, ProcedureQuery, QualifiedQuery, QueryChain, RelationshipQuery, SelectQuery, SQLTemplate, UpdateBatchQuery, UpdateQuery

    public interface Query

extends java.io.Serializable

Defines minimal API of a query descriptor that is executable via Cayenne.

Author:
  Andrus Adamchik

Method Summary
`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.
`java.lang.String` | `getName()` Returns a symbolic name of the query.
`java.lang.Object` | `getRoot()` Deprecated. since 1.2. Query "root" is now accessed via `getMetaData(EntityResolver)`.
`void` | `route(QueryRouter router, EntityResolver resolver, Query substitutedQuery)` A callback method invoked by Cayenne during the routing phase of the query execution.
`void` | `setName(java.lang.String name)` Deprecated. since 1.2
`void` | `setRoot(java.lang.Object root)` Deprecated. since 1.2. Query "root" is now accessed via `getMetaData(EntityResolver)`.

Method Detail

### getMetaData

    QueryMetadata getMetaData(EntityResolver resolver)

  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.

  Since:
    1.2

### route

    void route(QueryRouter router,
               EntityResolver resolver,
               Query substitutedQuery)

  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.

  Since:
    1.2

### createSQLAction

    SQLAction createSQLAction(SQLActionVisitor visitor)

  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.

  Since:
    1.2

### getName

    java.lang.String getName()

  Returns a symbolic name of the query. The name may be used as a key to find queries stored in the DataMap. Some query implementors reuse the name as a QueryMetadata cache key. Generally the name can be null.

  Since:
    1.1

### setName

    void setName(java.lang.String name)

  Deprecated. since 1.2

  Sets a symbolic name of the query.

  Since:
    1.1

### getRoot

    java.lang.Object getRoot()

  Deprecated. since 1.2. Query "root" is now accessed via `getMetaData(EntityResolver)`.

  Returns the root object of the query.

### setRoot

    void setRoot(java.lang.Object root)

  Deprecated. since 1.2. Query "root" is now accessed via `getMetaData(EntityResolver)`.

  Sets the root of the query.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2006 Apache.org All Rights Reserved.