Skip Headers

# Adding Named Queries

Previous

Next

Use this dialog box to create a new named query.

Use the following information to complete the dialog box and create the named query:

Field | Description
--- | ---
Variety | For EJB descriptors only, select the variety of query:
TopLink Named Query | Select to create a general purpose TopLink query of the type given by the Type area. You can execute this query by name on the TopLink session passing in the class and arguments (see "Using Named Queries").
EJB Finder | Select to create a TopLink query of the type given by the Type area for use as the implementation of the EJB finder method of the name you specify. The TopLink runtime executes this query when you call the EJB finder method of the given name.
TopLink Reserved Finder | Select to create a TopLink query of the type given by the Type area for use as the implementation of the TopLink reserved finder method name you select. The TopLink runtime executes this query when you call the EJB finder method of the given name. For more information, see "Predefined Finders".
EJB Select | Select to create a TopLink query of the type given by the Type area for use as the implementation of the EJB life cycle method `ejbSelect`. The TopLink runtime executes this query whenever the `ejbSelect` method is called.

Type

Select the type of query:

- ReadObject (`ReadObjectQuery`)

- ReadAll (`ReadAllQuery`)

- Report Foot 1 (`ReportQuery`)

Note: If Variety is set to TopLink Reserved Finder, you cannot select a query Type .

Name

The name of this query.

- If Variety is set to TopLink Named Query, you can specify any name.

- If Variety is set to EJB Finder, the name must be prefixed by find.

- If Variety is set to TopLink Reserved Finder, select from the list of available names that TopLink reserves. For more information, see "Predefined Finders".

- If Variety is set to EJB Select, the name must be ejbSelect.

Footnote 1 Relational descriptors only.

Enter the necessary information and click OK. TopLink Workbench adds the query to the list of queries in the Named Query tab.

See Also

  Configuring Named Queries at the Descriptor Level