Chapter 8. JDOQL Editor

8.1. Query Validator
8.2. Candidate Class Editor
8.3. Filter Editor
8.4. Additional Query Component Editors
8.4.1. Ordering Editor
8.4.2. Parameters Editor
8.4.3. Imports Editor
8.4.4. Variables Editor
8.4.5. Aggregates and Projections Editor
8.4.6. Fetch Configuration Editor
8.5. Execute Query
8.6. Show SQL
8.7. Clear Query
8.8. Show Java
8.9. Save Query
8.10. Load Query
8.11. Recent Queries
8.12. Results Browser

The JDOQL Editor provides a means to compose, validate, and test queries against your database. This is useful both in terms of validating your metadata and mappings for your classes, as well as providing a simple graphical mechanism for browsing the contents of your database and traversing relations.

The JDOQL Editor consists of two components: on the left is set of components that can be used to build up the query. On the right side is information about the results of the query: the SQL that was executed in order to execute the query, as well as tree that provides information on the fields that were retrieved from the database.

This section describes the various GUI components that are used to build up queries. For more details about the meaning of the various elements of JDO queries, see Chapter 11, Query.

8.1. Query Validator

The toolbar in the upper-left corner of the JDOQL editor contain a series of buttons that are used to build up and execute the query. The leftmost component an icon that will be either a yellow warning icon, which indicates that the the query is invalid, or a checkbox, which indicates that the query is syntactically valid. When the query is invalid for any reason, placing the mouse over the warning icon will provide some information in the tooltip text about why the query is not valid, which can assist in fixing the query. Note that even when the query is syntactically valid, executing the query may still cause an error (in which case a window will open describing the error). For example, this might happen if the mappings for the class are set up incorrectly, such as when a class is mapped to a non-existent table.