# Package org.apache.cayenne.query

package org.apache.cayenne.query
Defines standard queries supported by Cayenne and extension mechanism to create custom queries. Many of the queries in this package are used by the framework internally. Normally users would only care about these general query classes:

- SelectQuery
- SQLTemplate
- ProcedureQuery

and sometimes - these specialized queries:

- QueryChain
- RelationshipQuery
- SingleObjectQuery

Cayenne can "execute" any object as a query as long as it implements Query interface and provides meaningful implementation of either Query.route(...) and/or Query.createSQLAction(SQLActionVisitor)} methods. So users can extend/customize queries if they need to. Custom implementations would normally either create a query from a standard Cayenne set and delegate the execution to it (acting as a sort of "query builder"), or can implement its own non-standard SQLAction.

- Related Packages
  Package
  Description
  org.apache.cayenne
  Contains persistence APIs directly accessible by users.
- Class
  Description
  AbstractMappedQuery
  AbstractQuery
  A common superclass of Cayenne queries.
  BatchQuery
  BatchQuery and its descendants allow to group similar data for the batch database modifications, including inserts, updates and deletes.
  BatchQueryRow
  Represents a single row of values in a BatchQuery.
  CacheableQuery
  Shared functionality for cacheable queries.
  CapsStrategy
  Defines forced capitalization of the result column names in the DataRow.
  ColumnSelect<T>
  A helper builder for queries selecting individual properties based on the root object.
  DefaultEmbeddableResultSegment
  DeleteBatchQuery
  Batched delete query.
  EJBQLQuery
  An EJBQL query representation in Cayenne.
  EmbeddableResultSegment
  EntityResultSegment
  A "compiled" version of a `EntityResult` descriptor.
  FluentSelect<T>
  Base class for `ObjectSelect` and `ColumnSelect`
  IndirectQuery
  A base superclass for queries that resolve into some other queries during the routing phase.
  InsertBatchQuery
  Batched INSERT query.
  MappedExec
  A query that represents a named parameterized non selecting query stored in the mapping.
  MappedSelect<T>
  A query that represents a named parameterized selecting query stored in the mapping.
  ObjectIdQuery
  A query that matches zero or one object or data row corresponding to the ObjectId.
  ObjectSelect<T>
  A selecting query providing chainable API.
  Ordering
  Defines object sorting criteria, used either for in-memory sorting of object lists or as a specification for building ORDER BY clause of a SelectQuery query.
  Orderings
  Orderings is provided so that you can chain Ordering together and then use the result to pass into methods that require List<Ordering>
  ParameterizedQuery
  Defines a query that can serve as a template for other queries.
  PrefetchProcessor
  A hierarchical visitor interface for traversing a tree of PrefetchTreeNodes.
  PrefetchSelectQuery<T>
  A SelectQuery to perform a prefetch based on another query.
  PrefetchTreeNode
  Defines a node in a prefetch tree.
  ProcedureCall<T>
  Fluent API for calling stored procedures.
  ProcedureQuery
  A query based on Procedure.
  Query
  Defines minimal API of a query descriptor that is executable via Cayenne.
  QueryCacheStrategy
  Defines query result caching policy.
  QueryChain
  A Query decorator for a collection of other queries.
  QueryMetadata
  Provides a common interface for accessing query metadata.
  QueryMetadataProxy
  QueryRouter
  An interface used by Queries to route themselves to an appropriate QueryEngine.
  RefreshQuery
  A query that allows to explicitly clear both object and list caches either via refetch (eager refresh) or invalidate (lazy refresh).
  RelationshipQuery
  A query that selects objects related to a given object via a mapped relationship.
  ScalarResultSegment
  Select<T>
  A common interface for grouping together different kinds of queries that return results.
  SelectById<T>
  A query to select objects by id.
  SelectById.IdSpec
  SelectById.MultiMapIdSpec
  SelectById.MultiScalarIdSpec
  SelectById.QueryRoot
  SelectById.SingleMapIdSpec
  SelectById.SingleScalarIdSpec
  SelectQuery<T>
  Deprecated.
  since 4.2, use `ObjectSelect`
  SortOrder
  Constants to order query results (the ORDER BY clause).
  SQLAction
  Defines API for query execution strategy over JDBC connection (as in Strategy Pattern).
  SQLActionVisitor
  A factory interface to create standard SQLActions for a set of standard queries.
  SQLExec
  A generic query based on raw SQL and featuring fluent API.
  SQLSelect<T>
  A selecting query based on raw SQL and featuring fluent API.
  SQLTemplate
  A query that executes unchanged (except for template preprocessing) "raw" SQL specified by the user.
  SQLTemplateMetadata
  UpdateBatchQuery
  Batched UPDATE query.