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.
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.