db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Bouschen <mbo.t...@spree.de>
Subject Re: Clarification needed on class names in query filters
Date Wed, 28 Dec 2005 22:04:52 GMT
Hi Andy,

I agree JDOQL should support accessing static fields of an arbitrary 
class and not just of java.lang classes. I like your proposal: "... 
members of the candidate class, or they are qualified by the class and 
can be resolved to a static field of that name in the specified 
class....". Please note this includes that the the class qualifier might 
be a fully qualified class name. So for a path expression 'a.b.c' the 
query compiler needs to analyze the entire path expression, before it 
can decide that 'a' is an implicit variable.

Regards Michael

>Hi Craig,
>
>  
>
>><spec>
>>Names in the filter are treated as parameters if they are explicitly
>>declared via declareParameters or if they begin with “:”. A14.6.5-4
>>[Names are treated as variable names if they are explicitly declared
>>via declareVariables. Otherwise, names are treated as field names if
>>they are members of the candidate class. Finally, names are treated
>>as implicitly defined variable names.]
>></spec>
>>
>>Any suggestions for improvement?
>>    
>>
>
>How about this :-
>
><spec>
>Names in the filter are treated as parameters if they are explicitly
>declared via declareParameters or if they begin with “:”.
>Names are treated as variable names if they are explicitly declared
>via declareVariables.
>Names are treated as field names if they are either members of the candidate 
>class, or they are qualified by the class and can be resolved to a static 
>field of that name in the specified class.
>Otherwise, names are treated as implicitly defined variable names.
></spec>
>
>This then allows access to static fields in *all* classes and not just the 
>java.lang classes. So a user can specify Integer.MAX_VALUE, 
>MyClass.MY_STATIC_FIELD, java.awt.Color.BLACK or whatever and since they are 
>prefixed by the class name, the (static) field will be found and can be used.
>
>
>  
>


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


Mime
View raw message