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

# Interface ParameterizedQuery

All Superinterfaces:
  `Query, Serializable`

All Known Implementing Classes:
  `ObjectSelect, PrefetchSelectQuery, ProcedureQuery, SQLTemplate`

public interface ParameterizedQuery extends Query
Defines a query that can serve as a template for other queries. ParameterizedQuery interface is used mainly in DataContext convenience methods, simplifying execution of the mapped queries.

Since:
  1.1

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Query`
  `createQuery(Map<String,?> parameters)`
  Creates a new query based on current query as a template, and using a Map of named parameters.

  ### Methods inherited from interface Query

  `createSQLAction, getMetaData, route`
  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.
  `void`
  `route(QueryRouter router, EntityResolver resolver, Query substitutedQuery)`
  A callback method invoked by Cayenne during the routing phase of the query execution.

- ## Method Details

  - ### createQuery

    Query createQuery(Map<String,?> parameters)
    Creates a new query based on current query as a template, and using a Map of named parameters. In case of select queries, it is up to the implementing query to name the new query to avoid cache key conflicts.