|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jdo.impl.jdoql.QueryImpl
This class implements the JDO query interface
(see Query
).
Constructor Summary | |
QueryImpl(PersistenceManagerInternal pm)
Create an empty query instance with no elements. |
|
QueryImpl(PersistenceManagerInternal pm,
java.lang.Class cls)
Create a new Query specifying the Class of the candidate instances. |
|
QueryImpl(PersistenceManagerInternal pm,
java.lang.Class cls,
java.util.Collection cln)
Create a query instance with the candidate class and candidate collection specified. |
|
QueryImpl(PersistenceManagerInternal pm,
java.lang.Class cls,
java.util.Collection cln,
java.lang.String filter)
Create a new Query with the Class of the candidate instances, candidate Collection, and filter. |
|
QueryImpl(PersistenceManagerInternal pm,
java.lang.Class cls,
java.lang.String filter)
Create a new Query with the Class of the candidate instances and Filter. |
|
QueryImpl(PersistenceManagerInternal pm,
javax.jdo.Extent cln)
Create a new Query with the candidate Extent; the class is taken from the Extent. |
|
QueryImpl(PersistenceManagerInternal pm,
javax.jdo.Extent cln,
java.lang.String filter)
Create a new Query with the candidate Extent and filter; the class is taken from the Extent. |
|
QueryImpl(PersistenceManagerInternal pm,
java.lang.Object compiled)
Create a new Query using elements from another Query. |
Method Summary | |
void |
close(java.lang.Object queryResult)
Close a query result and release any resources associated with it. |
void |
closeAll()
Close all query results associated with this Query instance, and release all resources associated with them. |
void |
compile()
Verify the elements of the query and provide a hint to the query to prepare and optimize an execution plan. |
void |
declareImports(java.lang.String imports)
Set the import statements to be used to identify the fully qualified name of variables or parameters. |
void |
declareParameters(java.lang.String parameters)
Declare the list of parameters query execution. |
void |
declareVariables(java.lang.String variables)
Declare the unbound variables to be used in the query. |
java.lang.Object |
execute()
Execute the query and return the filtered Collection. |
java.lang.Object |
execute(java.lang.Object p1)
Execute the query and return the filtered Collection. |
java.lang.Object |
execute(java.lang.Object p1,
java.lang.Object p2)
Execute the query and return the filtered Collection. |
java.lang.Object |
execute(java.lang.Object p1,
java.lang.Object p2,
java.lang.Object p3)
Execute the query and return the filtered Collection. |
java.lang.Object |
executeWithArray(java.lang.Object[] parameters)
Execute the query and return the filtered Collection. |
java.lang.Object |
executeWithMap(java.util.Map parameters)
Execute the query and return the filtered Collection. |
boolean |
getIgnoreCache()
Get the ignoreCache option setting. |
javax.jdo.PersistenceManager |
getPersistenceManager()
Get the PersistenceManager associated with this Query. |
void |
setCandidates(java.util.Collection pcs)
Set the candidate Collection to query. |
void |
setCandidates(javax.jdo.Extent pcs)
Set the candidate Extent to query. |
void |
setClass(java.lang.Class cls)
Set the class of the candidate instances of the query. |
void |
setFilter(java.lang.String filter)
Set the filter for the query. |
void |
setIgnoreCache(boolean ignoreCache)
Set the ignoreCache option. |
void |
setOrdering(java.lang.String ordering)
Set the ordering specification for the result Collection. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public QueryImpl(PersistenceManagerInternal pm)
public QueryImpl(PersistenceManagerInternal pm, java.lang.Object compiled)
All of the settings of the other Query are copied to this Query, except for the candidate Collection or Extent.
compiled
- another Query from the same JDO implementationpublic QueryImpl(PersistenceManagerInternal pm, java.lang.Class cls)
cls
- the Class of the candidate instancespublic QueryImpl(PersistenceManagerInternal pm, javax.jdo.Extent cln)
cln
- the Extent of candidate instancespublic QueryImpl(PersistenceManagerInternal pm, java.lang.Class cls, java.util.Collection cln)
cls
- the Class of the candidate instances.cln
- the Collection of candidate instances.public QueryImpl(PersistenceManagerInternal pm, java.lang.Class cls, java.lang.String filter)
cls
- the Class of resultsfilter
- the filter for candidate instancespublic QueryImpl(PersistenceManagerInternal pm, java.lang.Class cls, java.util.Collection cln, java.lang.String filter)
cls
- the Class of candidate instancescln
- the Collection of candidate instancesfilter
- the filter for candidate instancespublic QueryImpl(PersistenceManagerInternal pm, javax.jdo.Extent cln, java.lang.String filter)
cln
- the Extent of candidate instancesfilter
- the filter for candidate instancesMethod Detail |
public void setClass(java.lang.Class cls)
The class specifies the class of the candidates of the query. Elements of the candidate collection that are of the specified class are filtered before being put into the result Collection.
setClass
in interface javax.jdo.Query
cls
- the Class of the candidate instances.public void setCandidates(javax.jdo.Extent pcs)
setCandidates
in interface javax.jdo.Query
pcs
- the Candidate Extent.public void setCandidates(java.util.Collection pcs)
setCandidates
in interface javax.jdo.Query
pcs
- the Candidate collection.public void setFilter(java.lang.String filter)
setFilter
in interface javax.jdo.Query
filter
- the query filter.public void declareImports(java.lang.String imports)
The String parameter to this method follows the syntax of the import statement of the Java language.
declareImports
in interface javax.jdo.Query
imports
- import statements separated by semicolons.public void declareParameters(java.lang.String parameters)
The String parameter to this method follows the syntax for formal parameters in the Java language.
declareParameters
in interface javax.jdo.Query
parameters
- the list of parameters separated by commas.public void declareVariables(java.lang.String variables)
declareVariables
in interface javax.jdo.Query
variables
- the variables separated by semicolons.public void setOrdering(java.lang.String ordering)
Each ordering declaration is the name of the field on which to order the results followed by one of the following words: "ascending" or "descending".
The field must be declared in the candidate class or must be a navigation expression starting with a field in the candidate class.
Valid field types are primitive types except boolean; wrapper types except Boolean; BigDecimal; BigInteger; String; and Date.
setOrdering
in interface javax.jdo.Query
ordering
- the ordering specification.public void setIgnoreCache(boolean ignoreCache)
setIgnoreCache
in interface javax.jdo.Query
ignoreCache
- the setting of the ignoreCache option.public boolean getIgnoreCache()
getIgnoreCache
in interface javax.jdo.Query
setIgnoreCache(boolean)
public void compile()
compile
in interface javax.jdo.Query
public java.lang.Object execute()
execute
in interface javax.jdo.Query
executeWithArray(Object[] parameters)
public java.lang.Object execute(java.lang.Object p1)
execute
in interface javax.jdo.Query
p1
- the value of the first parameter declared.
executeWithArray(Object[] parameters)
public java.lang.Object execute(java.lang.Object p1, java.lang.Object p2)
execute
in interface javax.jdo.Query
p1
- the value of the first parameter declared.p2
- the value of the second parameter declared.
executeWithArray(Object[] parameters)
public java.lang.Object execute(java.lang.Object p1, java.lang.Object p2, java.lang.Object p3)
execute
in interface javax.jdo.Query
p1
- the value of the first parameter declared.p2
- the value of the second parameter declared.p3
- the value of the third parameter declared.
executeWithArray(Object[] parameters)
public java.lang.Object executeWithMap(java.util.Map parameters)
executeWithMap
in interface javax.jdo.Query
parameters
- the Map containing all of the parameters.
executeWithArray(Object[] parameters)
public java.lang.Object executeWithArray(java.lang.Object[] parameters)
The execution of the query obtains the values of the parameters and matches them against the declared parameters in order. The names of the declared parameters are ignored. The type of the declared parameters must match the type of the passed parameters, except that the passed parameters might need to be unwrapped to get their primitive values.
The filter, import, declared parameters, declared variables, and ordering statements are verified for consisten1cy.
Each element in the candidate Collection is examined to see that it is assignment compatible to the Class of the query. It is then evaluated by the boolean expression of the filter. The element passes the filter if there exist unique values for all variables for which the filter expression evaluates to true.
executeWithArray
in interface javax.jdo.Query
parameters
- the Object array with all of the parameters.
public javax.jdo.PersistenceManager getPersistenceManager()
If this Query was restored from a serialized form, it has no PersistenceManager, and this method returns null.
getPersistenceManager
in interface javax.jdo.Query
public void close(java.lang.Object queryResult)
close
in interface javax.jdo.Query
queryResult
- the result of execute(...) on this Query instance.public void closeAll()
closeAll
in interface javax.jdo.Query
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |