org.jpox.store.query
Class Query

java.lang.Object
  extended byorg.jpox.store.query.Query
All Implemented Interfaces:
javax.jdo.Query, java.io.Serializable
Direct Known Subclasses:
BaseSQLQuery, JDOQLQuery

public abstract class Query
extends java.lang.Object
implements javax.jdo.Query

Abstract implementation of the JDO query interface. Provides a base for all query languages supported by JPOX.

Version:
$Revision: 1.54 $
See Also:
Query, Serialized Form

Nested Class Summary
static interface Query.ResultObjectFactory
          An object that reads result set rows and returns corresponding persistent objects from them.
 
Field Summary
protected  java.lang.Class candidateClass
          The candidate class for this query.
protected  java.lang.String candidateClassName
          Name of the candidate class (used when specified via Single-String).
protected  DatastoreAdapter dba
           
protected  java.util.Map extensions
          Any JPOX extensions
protected  javax.jdo.FetchPlan fetchPlan
          Fetch Plan to use for the query.
protected  java.lang.String filter
          The filter for the query.
protected  long fromInclNo
          Query result range start position (included).
protected  java.lang.String grouping
          Grouping clause for the query, for use with aggregate expressions.
protected  boolean ignoreCache
          Whether to ignore dirty instances in the query.
protected  java.lang.String imports
          Any import declarations for the types used in the query.
protected  boolean isCompiled
          State variable for the compilation state
protected  boolean isPreCompile
          State variable for whether the query hasnt yet passed the JDO "compile" step (preCompile=true).
protected static Localiser LOCALISER
          Localiser for messages.
protected  java.lang.String ordering
          Ordering clause for the query, governing the order objects are returned.
protected  java.util.List parameterNames
          The parameter names.
protected  java.lang.String parameters
          Any explicit parameters defined for this query.
protected  java.util.Map parameterTypesByName
          Look-up for the parameter types, keyed by the name.
protected  Imports parsedImports
          The imports definition.
protected  PersistenceManager pm
           
protected  java.util.HashSet queryResults
          All query results obtained from this query.
protected  java.lang.String range
          String form of the query result range.
protected  java.lang.String result
          Specification of the result of the query e.g aggregates etc.
protected  java.lang.Class resultClass
          User-defined class that best represents the results of a query.
protected  java.lang.String resultClassName
          Name of user-defined class to use as the result class.
protected  boolean subclasses
          Whether to allow subclasses of the candidate class be returned.
protected  long toExclNo
          Query result range end position (excluded).
protected  boolean unique
          Whether to return single value, or collection from the query.
protected  boolean unmodifiable
          Whether the query can be modified
protected  java.util.List variableNames
          The variables names.
protected  java.lang.String variables
          Any explicit variables defined for this query.
protected  java.util.Map variableTypesByName
          Look-up for the variables types, keyed by the name.
 
Fields inherited from interface javax.jdo.Query
JDOQL, SQL
 
Constructor Summary
Query(PersistenceManager pm)
          Constructs a new query instance that uses the given persistence manager.
 
Method Summary
 void addExtension(java.lang.String key, java.lang.Object value)
          Add a vendor-specific extension this query.
protected  void assertIsModifiable()
          Method to throw a JDOUserException if the query is currently not modifiable.
 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.
 long deletePersistentAll()
          Method to delete all objects found by this query, without instantiating them into memory.
 long deletePersistentAll(java.util.Map parameters)
          Method to delete all objects found by this query, without instantiating them into memory.
 long deletePersistentAll(java.lang.Object[] parameters)
          Method to delete all objects found by this query, without instantiating them into memory.
protected  void discardCompiled()
          Utility to remove any previous compilation of this Query.
 boolean equals(java.lang.Object obj)
          Equality operator.
 java.lang.Object execute()
          Execute the query and return the filtered List.
 java.lang.Object execute(java.lang.Object p1)
          Execute the query and return the filtered List.
 java.lang.Object execute(java.lang.Object p1, java.lang.Object p2)
          Execute the query and return the filtered List.
 java.lang.Object execute(java.lang.Object p1, java.lang.Object p2, java.lang.Object p3)
          Execute the query and return the filtered List.
protected  java.sql.ResultSet executeQuery(java.lang.String statement, java.sql.PreparedStatement ps)
          Convenience wrapper to executing JDBC queries.
 java.lang.Object executeWithArray(java.lang.Object[] parameterValues)
          Execute the query and return the filtered List.
 java.lang.Object executeWithMap(java.util.Map parameters)
          Execute the query and return the filtered result(s).
 java.lang.Class getCandidateClass()
          Accessor for the class of the candidate instances of the query.
protected  java.lang.ClassLoader getCandidateLoader()
          Returns the class loader of the candidade class
 java.lang.Object getExtension(java.lang.String key)
          Accessor for the value of an extension for this query.
 javax.jdo.FetchPlan getFetchPlan()
          This method retrieves the fetch plan associated with the Query.
 boolean getIgnoreCache()
          Accessor for the ignoreCache option setting.
 javax.jdo.PersistenceManager getPersistenceManager()
          Accessor for the PersistenceManager associated with this Query.
protected  java.lang.String getResultSetConcurrency()
          Accessor for the result set concurrency.
protected  java.lang.String getResultSetType()
          Accessor for the result set type.
protected  java.sql.PreparedStatement getStatement(java.sql.Connection conn, StatementText stmtText)
          Method to create a PreparedStatement for use with the query.
protected  java.sql.PreparedStatement getStatement(java.sql.Connection conn, java.lang.String queryStmt)
          Method to create a PreparedStatement for use with the query.
 StoreManager getStoreManager()
          Accessor for the StoreManager associated with this Query.
 int hashCode()
          Hashcode generator.
 boolean isSubclasses()
          Accessor for whether this query includes subclasses
 boolean isUnmodifiable()
          Accessor for unmodifiable.
protected abstract  long performDeletePersistentAll(java.util.Map parameters)
          Method to actually execute the deletion of objects.
protected abstract  java.util.Collection performExecute(java.util.Map parameters)
          Method to actually execute the query.
protected  void prepareStatementForExecution(java.sql.PreparedStatement ps)
          Method to apply any query timeouts, and to add any restrictions to the created ResultSet.
 java.lang.Class resolveClassDeclaration(java.lang.String classDecl)
          Utility to resolve the declaration to a particular class.
 void setCandidateClassName(java.lang.String candidateClassName)
          Convenience method to set the name of the candidate class.
abstract  void setCandidates(java.util.Collection pcs)
          Set the candidate Collection to query.
abstract  void setCandidates(javax.jdo.Extent pcs)
          Set the candidate Extent to query.
 void setClass(java.lang.Class candidateClass)
          Mutator for the class of the candidate instances of the query.
 void setExtensions(java.util.Map extensions)
          Set multiple extensions, or use null to clear extensions.
 void setFilter(java.lang.String filter)
          Set the filter for the query.
 void setGrouping(java.lang.String grouping)
          Set the grouping specification for the result Collection.
 void setIgnoreCache(boolean ignoreCache)
          Set the ignoreCache option.
 void setOrdering(java.lang.String ordering)
          Set the ordering specification for the result Collection.
 void setRange(long fromIncl, long toExcl)
          Set the range of the results.
 void setRange(java.lang.String range)
          Set the range of the results.
 void setResult(java.lang.String result)
          Set the result for the results.
 void setResultClass(java.lang.Class result_cls)
          Set the result class for the results.
 void setResultClassName(java.lang.String resultClassName)
          Convenience method to set the name of the result class.
 void setSubclasses(boolean subclasses)
          Mutator for whether this query includes subclasses
 void setUnique(boolean unique)
          Set the uniqueness of the results.
 void setUnmodifiable()
          Mutator for unmodifiable.
protected abstract  boolean shouldReturnSingleRow()
          Convenience method to return whether the query should return a single row.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALISER

protected static final Localiser LOCALISER
Localiser for messages.


pm

protected final transient PersistenceManager pm

dba

protected final transient DatastoreAdapter dba

candidateClass

protected java.lang.Class candidateClass
The candidate class for this query.


candidateClassName

protected java.lang.String candidateClassName
Name of the candidate class (used when specified via Single-String).


subclasses

protected boolean subclasses
Whether to allow subclasses of the candidate class be returned.


unique

protected boolean unique
Whether to return single value, or collection from the query.


result

protected java.lang.String result
Specification of the result of the query e.g aggregates etc.


resultClass

protected java.lang.Class resultClass
User-defined class that best represents the results of a query. Populated if specified via setResultClass().


resultClassName

protected java.lang.String resultClassName
Name of user-defined class to use as the result class.


filter

protected java.lang.String filter
The filter for the query.


imports

protected java.lang.String imports
Any import declarations for the types used in the query.


variables

protected java.lang.String variables
Any explicit variables defined for this query.


parameters

protected java.lang.String parameters
Any explicit parameters defined for this query.


ordering

protected java.lang.String ordering
Ordering clause for the query, governing the order objects are returned.


grouping

protected java.lang.String grouping
Grouping clause for the query, for use with aggregate expressions.


range

protected java.lang.String range
String form of the query result range. Only populated if specified via String.


fromInclNo

protected long fromInclNo
Query result range start position (included). Either specified, or compiled from "range".


toExclNo

protected long toExclNo
Query result range end position (excluded). Either specified, or compiled from "range".


unmodifiable

protected boolean unmodifiable
Whether the query can be modified


ignoreCache

protected boolean ignoreCache
Whether to ignore dirty instances in the query.


fetchPlan

protected final javax.jdo.FetchPlan fetchPlan
Fetch Plan to use for the query.


isCompiled

protected transient boolean isCompiled
State variable for the compilation state


parsedImports

protected transient Imports parsedImports
The imports definition.


parameterNames

protected transient java.util.List parameterNames
The parameter names.


parameterTypesByName

protected transient java.util.Map parameterTypesByName
Look-up for the parameter types, keyed by the name.


variableNames

protected transient java.util.List variableNames
The variables names.


variableTypesByName

protected transient java.util.Map variableTypesByName
Look-up for the variables types, keyed by the name.


queryResults

protected transient java.util.HashSet queryResults
All query results obtained from this query. This is required because the query can be executed multiple times changing the input slightly each time for example.


isPreCompile

protected transient boolean isPreCompile
State variable for whether the query hasnt yet passed the JDO "compile" step (preCompile=true).


extensions

protected java.util.Map extensions
Any JPOX extensions

Constructor Detail

Query

public Query(PersistenceManager pm)
Constructs a new query instance that uses the given persistence manager.

Parameters:
pm - The Persistence Manager for this query.
Method Detail

getCandidateLoader

protected java.lang.ClassLoader getCandidateLoader()
Returns the class loader of the candidade class

Returns:
the ClassLoader for the candidate class

discardCompiled

protected void discardCompiled()
Utility to remove any previous compilation of this Query.


equals

public boolean equals(java.lang.Object obj)
Equality operator.

Parameters:
obj - Object to compare against
Returns:
Whether this and the other object are equal.

hashCode

public int hashCode()
Hashcode generator.

Returns:
The Hashcode for this object.

getStoreManager

public StoreManager getStoreManager()
Accessor for the StoreManager associated with this Query.

Returns:
the StoreManager associated with this Query.

getPersistenceManager

public javax.jdo.PersistenceManager getPersistenceManager()
Accessor for the PersistenceManager associated with this Query.

Specified by:
getPersistenceManager in interface javax.jdo.Query
Returns:
the PersistenceManager associated with this Query.
See Also:
Query.getPersistenceManager()

addExtension

public void addExtension(java.lang.String key,
                         java.lang.Object value)
Add a vendor-specific extension this query. The key and value are not standard. An implementation must ignore keys that are not recognized.

Specified by:
addExtension in interface javax.jdo.Query
Parameters:
key - the extension key
value - the extension value
Since:
JDO 2.0

setExtensions

public void setExtensions(java.util.Map extensions)
Set multiple extensions, or use null to clear extensions. Map keys and values are not standard. An implementation must ignore entries that are not recognized.

Specified by:
setExtensions in interface javax.jdo.Query
Parameters:
extensions -
Since:
1.1
See Also:
addExtension(java.lang.String, java.lang.Object)

getExtension

public java.lang.Object getExtension(java.lang.String key)
Accessor for the value of an extension for this query.

Parameters:
key - The key
Returns:
The value (if this extension is specified)

getFetchPlan

public javax.jdo.FetchPlan getFetchPlan()
This method retrieves the fetch plan associated with the Query. It always returns the identical instance for the same Query instance. Any change made to the fetch plan affects subsequent query execution. Fetch plan is described in Section 12.7

Specified by:
getFetchPlan in interface javax.jdo.Query
Returns:
the FetchPlan

getCandidateClass

public java.lang.Class getCandidateClass()
Accessor for the class of the candidate instances of the query.

Returns:
the Class of the candidate instances.
See Also:
Query.setClass(java.lang.Class)

setClass

public void setClass(java.lang.Class candidateClass)
Mutator for the class of the candidate instances of the query.

Specified by:
setClass in interface javax.jdo.Query
Parameters:
candidateClass - the Class of the candidate instances.
See Also:
Query.setClass(java.lang.Class)

setCandidateClassName

public void setCandidateClassName(java.lang.String candidateClassName)
Convenience method to set the name of the candidate class.

Parameters:
candidateClassName - Name of the candidate class

setCandidates

public abstract void setCandidates(javax.jdo.Extent pcs)
Set the candidate Extent to query. To be implemented by extensions.

Specified by:
setCandidates in interface javax.jdo.Query
Parameters:
pcs - the Candidate Extent.
See Also:
Query.setCandidates(javax.jdo.Extent)

setCandidates

public abstract void setCandidates(java.util.Collection pcs)
Set the candidate Collection to query. To be implemented by extensions.

Specified by:
setCandidates in interface javax.jdo.Query
Parameters:
pcs - the Candidate collection.
See Also:
Query.setCandidates(java.util.Collection)

setFilter

public void setFilter(java.lang.String filter)
Set the filter for the query.

Specified by:
setFilter in interface javax.jdo.Query
Parameters:
filter - the query filter.
See Also:
Query.setFilter(java.lang.String)

declareImports

public void declareImports(java.lang.String imports)
Set the import statements to be used to identify the fully qualified name of variables or parameters.

Specified by:
declareImports in interface javax.jdo.Query
Parameters:
imports - import statements separated by semicolons.
See Also:
Query.declareImports(java.lang.String)

declareParameters

public void declareParameters(java.lang.String parameters)
Declare the list of parameters query execution.

Specified by:
declareParameters in interface javax.jdo.Query
Parameters:
parameters - the list of parameters separated by commas.
See Also:
Query.declareParameters(java.lang.String)

declareVariables

public void declareVariables(java.lang.String variables)
Declare the unbound variables to be used in the query.

Specified by:
declareVariables in interface javax.jdo.Query
Parameters:
variables - the variables separated by semicolons.
See Also:
Query.declareVariables(java.lang.String)

setOrdering

public void setOrdering(java.lang.String ordering)
Set the ordering specification for the result Collection.

Specified by:
setOrdering in interface javax.jdo.Query
Parameters:
ordering - the ordering specification.
See Also:
Query.setOrdering(java.lang.String)

setGrouping

public void setGrouping(java.lang.String grouping)
Set the grouping specification for the result Collection.

Specified by:
setGrouping in interface javax.jdo.Query
Parameters:
grouping - the grouping specification.
See Also:
Query.setGrouping(java.lang.String)

setUnique

public void setUnique(boolean unique)
Set the uniqueness of the results. A value of true will return a single value (or null) where the application knows that there are 0 or 1 objects to be returned. See JDO 2.0 specification section 14.6

Specified by:
setUnique in interface javax.jdo.Query
Parameters:
unique - whether the result is unique
Since:
1.1
See Also:
Query.setUnique(boolean)

setRange

public void setRange(long fromIncl,
                     long toExcl)
Set the range of the results. By default all results are returned but this allows specification of a range of elements required. See JDO 2.0 specification section 14.6.8

Specified by:
setRange in interface javax.jdo.Query
Parameters:
fromIncl - From element no (inclusive) to return
toExcl - To element no (exclusive) to return
Since:
1.1
See Also:
Query.setRange(long, long)

setRange

public void setRange(java.lang.String range)
Set the range of the results. By default all results are returned but this allows specification of a range of elements required. See JDO 2.0 specification section 14.6.8

Specified by:
setRange in interface javax.jdo.Query
Parameters:
range - Range string
Since:
1.1
See Also:
Query.setRange(java.lang.String)

setResult

public void setResult(java.lang.String result)
Set the result for the results. The application might want to get results from a query that are not instances of the candidate class. The results might be fields of persistent instances, instances of classes other than the candidate class, or aggregates of fields.

Specified by:
setResult in interface javax.jdo.Query
Parameters:
result - The result parameter consists of the optional keyword distinct followed by a commaseparated list of named result expressions or a result class specification.
Since:
1.1
See Also:
Query.setResult(java.lang.String)

setResultClass

public void setResultClass(java.lang.Class result_cls)
Set the result class for the results. The result class must obey various things as per the JDO 2.0 spec 14.6.12.

Specified by:
setResultClass in interface javax.jdo.Query
Parameters:
result_cls - The result class
Since:
1.1
See Also:
Query.setResultClass(java.lang.Class)

setResultClassName

public void setResultClassName(java.lang.String resultClassName)
Convenience method to set the name of the result class.

Parameters:
resultClassName - Name of the result class

setIgnoreCache

public void setIgnoreCache(boolean ignoreCache)
Set the ignoreCache option. Currently this simply stores the ignoreCache value, and doesn't necessarily use it. The parameter is a "hint" to the query engine. TODO : Implement this fully.

Specified by:
setIgnoreCache in interface javax.jdo.Query
Parameters:
ignoreCache - the setting of the ignoreCache option.
See Also:
Query.setIgnoreCache(boolean), PersistenceManager.setIgnoreCache(boolean)

getIgnoreCache

public boolean getIgnoreCache()
Accessor for the ignoreCache option setting.

Specified by:
getIgnoreCache in interface javax.jdo.Query
Returns:
the ignoreCache option setting
See Also:
setIgnoreCache(boolean), Query.getIgnoreCache(), PersistenceManager.getIgnoreCache()

isSubclasses

public boolean isSubclasses()
Accessor for whether this query includes subclasses

Returns:
Returns whether the query includes subclasses.

setSubclasses

public void setSubclasses(boolean subclasses)
Mutator for whether this query includes subclasses

Parameters:
subclasses - Where subclasses of the candidate class are to be included.

isUnmodifiable

public boolean isUnmodifiable()
Accessor for unmodifiable.

Specified by:
isUnmodifiable in interface javax.jdo.Query
Returns:
Returns the unmodifiable.

assertIsModifiable

protected void assertIsModifiable()
Method to throw a JDOUserException if the query is currently not modifiable.

Throws:
javax.jdo.JDOUserException - Thrown when it is unmodifiable

setUnmodifiable

public void setUnmodifiable()
Mutator for unmodifiable.

Specified by:
setUnmodifiable in interface javax.jdo.Query

getResultSetType

protected java.lang.String getResultSetType()
Accessor for the result set type. Checks both the PMF, and also the query extensions.

Returns:
The result set type string

getResultSetConcurrency

protected java.lang.String getResultSetConcurrency()
Accessor for the result set concurrency. Checks both the PMF, and also the query extensions.

Returns:
The result set concurrency string

getStatement

protected java.sql.PreparedStatement getStatement(java.sql.Connection conn,
                                                  java.lang.String queryStmt)
                                           throws java.sql.SQLException
Method to create a PreparedStatement for use with the query.

Parameters:
conn - the Connection
queryStmt - The statement text for the query
Returns:
the PreparedStatement
Throws:
java.sql.SQLException - Thrown if an error occurs creating the statement

getStatement

protected java.sql.PreparedStatement getStatement(java.sql.Connection conn,
                                                  StatementText stmtText)
                                           throws java.sql.SQLException
Method to create a PreparedStatement for use with the query.

Parameters:
conn - the Connection
stmtText - The statement text
Returns:
the PreparedStatement
Throws:
java.sql.SQLException - Thrown if an error occurs creating the statement

prepareStatementForExecution

protected void prepareStatementForExecution(java.sql.PreparedStatement ps)
                                     throws java.sql.SQLException
Method to apply any query timeouts, and to add any restrictions to the created ResultSet.

Parameters:
ps - The PreparedStatement
Throws:
java.sql.SQLException - Thrown when an error occurs applying the constraints

compile

public void compile()
Verify the elements of the query and provide a hint to the query to prepare and optimize an execution plan. Processes the imports, explicit parameters, and explicit variables.

Specified by:
compile in interface javax.jdo.Query
See Also:
Query.compile()

resolveClassDeclaration

public java.lang.Class resolveClassDeclaration(java.lang.String classDecl)
Utility to resolve the declaration to a particular class. Takes the passed in name, together with the defined import declarations and returns the class represented by the declaration.

Parameters:
classDecl - The declaration
Returns:
The class it resolves to (if any)
Throws:
javax.jdo.JDOUserException - Thrown if the class cannot be resolved.

execute

public java.lang.Object execute()
Execute the query and return the filtered List.

Specified by:
execute in interface javax.jdo.Query
Returns:
the filtered List.
See Also:
Query.execute(), executeWithArray(Object[] parameters)

execute

public java.lang.Object execute(java.lang.Object p1)
Execute the query and return the filtered List.

Specified by:
execute in interface javax.jdo.Query
Parameters:
p1 - the value of the first parameter declared.
Returns:
the filtered List.
See Also:
Query.execute(Object), executeWithArray(Object[] parameters)

execute

public java.lang.Object execute(java.lang.Object p1,
                                java.lang.Object p2)
Execute the query and return the filtered List.

Specified by:
execute in interface javax.jdo.Query
Parameters:
p1 - the value of the first parameter declared.
p2 - the value of the second parameter declared.
Returns:
the filtered List.
See Also:
Query.execute(Object,Object), executeWithArray(Object[] parameters)

execute

public java.lang.Object execute(java.lang.Object p1,
                                java.lang.Object p2,
                                java.lang.Object p3)
Execute the query and return the filtered List.

Specified by:
execute in interface javax.jdo.Query
Parameters:
p1 - the value of the first parameter declared.
p2 - the value of the second parameter declared.
p3 - the value of the third parameter declared.
Returns:
the filtered List.
See Also:
Query.execute(Object,Object,Object), executeWithArray(Object[] parameters)

executeWithArray

public java.lang.Object executeWithArray(java.lang.Object[] parameterValues)
Execute the query and return the filtered List.

Specified by:
executeWithArray in interface javax.jdo.Query
Parameters:
parameterValues - the Object array with all of the parameters.
Returns:
the filtered List.
See Also:
Query.executeWithArray(Object[])

shouldReturnSingleRow

protected abstract boolean shouldReturnSingleRow()
Convenience method to return whether the query should return a single row.

Returns:
Whether a single row should result

executeWithMap

public java.lang.Object executeWithMap(java.util.Map parameters)
Execute the query and return the filtered result(s).

Specified by:
executeWithMap in interface javax.jdo.Query
Parameters:
parameters - the Map containing all of the parameters.
Returns:
the filtered results (List, or Object)
See Also:
Query.executeWithMap(Map), executeWithArray(Object[] parameters)

performExecute

protected abstract java.util.Collection performExecute(java.util.Map parameters)
Method to actually execute the query. To be implemented by extending classes for the particular query language.

Parameters:
parameters - Map containing the parameters.
Returns:
The filtered QueryResult.

executeQuery

protected java.sql.ResultSet executeQuery(java.lang.String statement,
                                          java.sql.PreparedStatement ps)
                                   throws java.sql.SQLException
Convenience wrapper to executing JDBC queries. Provides logging of the query and its execution time.

Parameters:
statement - The JDBC statement text
ps - The PreparedStatement
Returns:
The ResultSet for this query
Throws:
java.sql.SQLException - Thrown if an error occurs in the execution

deletePersistentAll

public long deletePersistentAll()
Method to delete all objects found by this query, without instantiating them into memory.

Specified by:
deletePersistentAll in interface javax.jdo.Query
Returns:
The number of deleted objects.
See Also:
Query.deletePersistentAll()

deletePersistentAll

public long deletePersistentAll(java.lang.Object[] parameters)
Method to delete all objects found by this query, without instantiating them into memory.

Specified by:
deletePersistentAll in interface javax.jdo.Query
Parameters:
parameters - the Object array with all of the parameters.
Returns:
the filtered Collection.
See Also:
Query.deletePersistentAll(Object[])

deletePersistentAll

public long deletePersistentAll(java.util.Map parameters)
Method to delete all objects found by this query, without instantiating them into memory.

Specified by:
deletePersistentAll in interface javax.jdo.Query
Parameters:
parameters - Map of parameters for the query
Returns:
the number of deleted objects
See Also:
Query.deletePersistentAll(Map)

performDeletePersistentAll

protected abstract long performDeletePersistentAll(java.util.Map parameters)
Method to actually execute the deletion of objects. To be implemented by extending classes.

Parameters:
parameters - Map containing the parameters.
Returns:
The filtered QueryResult.

close

public void close(java.lang.Object queryResult)
Close a query result and release any resources associated with it.

Specified by:
close in interface javax.jdo.Query
Parameters:
queryResult - the result of execute(...) on this Query instance.
See Also:
Query.close(java.lang.Object)

closeAll

public void closeAll()
Close all query results associated with this Query instance, and release all resources associated with them.

Specified by:
closeAll in interface javax.jdo.Query
See Also:
Query.closeAll()


Copyright © -2007 . All Rights Reserved.