Two namespaces exist in JDOQL queries; they contain:
The names of types
The names of fields, parameters, and variables
Parameters and variables are given a name and type when they are declared. The types of the parameters and variables are placed in the first namespace; the parameter and variable names are placed in the latter namespace.
When a type name is used (e.g., in a parameter or variable declaration), it must be one of the following:
The name of the candidate class
The name of a class or interface declared in the
The name of a class or interface imported by a call to
The name of a class or interface in the same package as the candidate class
A name imported by a type-import-on-demand declaration, as in "
The type namespace automatically includes the name of the
candidate class and the names of other classes in the same package. It
also automatically includes the names of the public types declared in
java.lang package, just as if
there had been a type-import-on-demand declaration (
You must include any additional types names necessary for the
types of parameters and variables. You import the types into a
Query instance by calling the
void declareImports(String imports);
imports contains one or more import
statements, separated by a semicolon. The syntax of the parameter is
identical to Java’s
import statements. All imports must be declared ...