132 Queries with JDOQL Query newQuery(Class cls, Collection
Query interface 133 I will describe each of the Query interface s methods briefly before we look at our first JDOQL examples. PersistenceManager getPersistenceManager() Returns a reference to the persistence manager with which the query is associated. void setClass() Sets the candidate class for the query. void setCandidates(Collection candidateCollection) Sets the candidate collection for the query. void setCandidates(Extent candidateExtent) Sets the candidate class and candidate collection for the query, from the values encapsulated in the Extent. void setFilter(String filter) Sets the filter criteria for the query. The filter should be valid according to the chosen query language. void declareImports(String imports) Provides an import declaration. This will import classes into the type name- space, so that these types can be used for the declaration of query parameters and variables. void declareVariables(String variables) void declareParameters(String parameters) void setOrdering(String ordering) Provide the variable, parameter and ordering declarations for the query. void setIgnoreCache(boolean ignoreCache) Boolean getIgnoreCache() These methods access the value for the IgnoreCache query property. If the property is set to true, the query might be executed such that changed instances in the persistence manager cache but not yet committed to the data store are ignored, and the currently persistent versions of those instances are queried instead. This may improve query execution speeds with some JDO implementations, at the expense of generating only approximate query results. As such it should probably be applied only to read-only transactions, within which data is queried but never altered. void compile() JDOQL does not require queries to be compiled. However, compilation of queries has two advantages. Firstly, any syntactic errors can be reported in advance of query execution. Secondly, a compiled query may execute more quickly than an uncompiled equivalent, although this is entirely implementation-dependent.
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision tomcat hosting services