Skip Headers

# Configuring Named Queries at the Session Level

Previous

Next

A named query is a TopLink query that you create and store, by name, in a session for later retrieval and execution. Named queries improve application performance, because they are prepared once and they (and all their associated supporting objects) can be efficiently reused thereafter making them well-suited for frequently executed operations.

If a named query is global to a project, configure it at the session level. Alternatively, you can configure a named query at the descriptor level (see "Configuring Named Queries at the Descriptor Level").

Use named queries to specify SQL, EJB QL, or TopLink `Expression` queries to access your data source.

Table: Session Support for Named Queries summarizes which sessions support named query configuration.

Session Support for Named Queries

Session | Using TopLink Workbench | Using Java
--- | --- | ---
Server and Client Sessions |  |
Session Broker and Client Sessions |  |
Database Sessions |  |

After you create a named query, you can execute it by name on the TopLink session (see "Using Named Queries").

For more information about named queries, see "Named Queries".