db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Jefferson <a...@jpox.org>
Subject Re: Clarification needed on class names in query filters
Date Tue, 27 Dec 2005 08:30:41 GMT
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.


-- 
Andy
Java Persistent Objects - JPOX

Mime
View raw message