Skip Headers

# Query Types

Previous

Next

Table: TopLink Query Types lists the query types that you can build in TopLink, and classifies them as basic or advanced.

TopLink Query Types

Query Type | Description | Type | TopLink Workbench | Java
--- | --- | --- | --- | ---
Session Queries | A query implicitly constructed and executed by a `Session` based on input parameters used to perform the most common data source actions on objects. | Basic |  |
Database Queries | A query also known as a query object query. An instance of `DatabaseQuery` that you create and then execute to perform any data source action on either objects or data. You can further refine a `DatabaseQuery` by also creating and configuring its `Call` (see "Call Queries"). | Basic |  |
Named Queries | An instance of `DatabaseQuery` stored by name in a `Session` or a descriptor's `DescriptorQueryManager` where it is constructed and prepared once. Such a query can then be repeatedly executed by name. | Basic |  |
Call Queries | An instance of `Call` that you create and then either execute directly, using a special `Session` API to perform limited data source actions on data only, or execute indirectly in the context of a `DatabaseQuery`. TopLink supports `Call` instances for custom SQL, stored procedures, and EIS interactions. | Basic |  |
Redirect Queries | An instance of `MethodBasedQueryRedirector` (taking the name of a static method and the `Class` in which it is defined as parameters) set on a named query. When the query is executed, the static method is invoked. | Advanced |  |
Historical Queries | Any query executed in the context of a historical session using the time-aware features of the TopLink `Expression` framework. | Advanced |  |
Interface and Inheritance Queries | Any query that references an interface type or super and subclasses of an inheritance hierarchy. | Advanced |  |
Descriptor Query Manager Queries | The `DescriptorQueryManager` defines a default `DatabaseQuery` for each basic data source operation (create, read, update, and delete), and provides an API with which you can customize either the `DatabaseQuery` or its `Call`. | Advanced |  |
EJB Finders | A query defined on the home interface of an enterprise bean that returns enterprise beans. You can implement finders using any TopLink query type, including `EJBQLCall`, a `Call` that takes EJB QL. | Advanced |  |

For more information, see the following:

- "Using Basic Query API"

- "Using Advanced Query API"

- "Query Concepts"