11-07-05 01:45 AM
Hi Craig,
> Javadogs,
>
> Did we really intend for the single string version of JDOQL to
> include "IMPORTS import..."?
I agree, the leading IMPORTS keyword seems to be redundant. We followed
the rule that all the query elements are prefixed with a new keyword in
the single string version (WHERE <filter>, VARIABLES <variables-clause>,
etc.). For imports this is not really necessary, because each import
statement starts with a keyword import already. So we can safely skip
the leading IMPORTS.
Regards Michael
[vbcol=seagreen]
>
> setFilter("SELECT e FROM EMPLOYEE e WHERE e.grade <
> HardClass.HIGHEST_GRADE");
> declareImports("import org.apache.jdo.tck.SimpleClass; import
> org.apache.jdo.tck.HardClass";
>
> pm.newQuery("SELECT e FROM EMPLOYEE e WHERE e.grade <
> HardClass.HIGHEST_GRADE IMPORTS import
> org.apache.jdo.tck.SimpleClass; import org.apache.jdo.tck.HardClass");
>
> Craig
>
> Chapter 14:
>
> void declareImports (String imports);
> A14.6-8 [Bind the import statements to the query instance.] All
> imports must be declared in the same method call, and the imports
> must be separated by semicolons.
>
> The import statements follow the Java syntax for import statements.
> Import statements are separated by semicolons. Import on demand is
> supported.
>
> Single-string Query element binding
> A14.6.13-1 [The String version of Query represents all query elements
> using a single string. The string contains the following structure:]
> select [unique] [ <result> ] [into <result-class-name>]
> [from <candidate-class-name> [exclude subclasses] ]
> [where <filter>]
> [variables <variables-clause> ]
> [parameters <parameters-clause>]
> [imports <imports-clause>]
> ...
>
> <imports-clause> is the imports declaration as in 14.6.4. As in Java,
> imports in the clause are separated by semicolons.
>
> Chapter 24:
>
> Imports:
> imports ImportList
>
> Import Declaration
> This section describes the syntax of the declareImports argument.
> ImportList:
> ImportDecls ;opt
> ImportDecls:
> ImportDecl
> ImportDecls ; ImportDecl
> ImportDecl:
> import QualifiedIdentifier
> import QualifiedIdentifier . *
> Please note, as a usability feature ImportList defines the trailing
> semicolon as optional (in addition to what the Java syntax allows in
> an import statement).
>
> JDOQLKeyword: one of
> ...
> having HAVING imports IMPORTS
> ...
>
>
> On Nov 4, 2005, at 5:17 AM, brazil@apache.org wrote:
>
--
Michael Bouschen Tech@Spree Engineering GmbH
mailto:mbo.tech@spree.de http://www.tech.spree.de/
Tel.:++49/30/235 520-33 Buelowstr. 66
Fax.:++49/30/2175 2012 D-10783 Berlin
[ Post a follow-up to this message ]
|