Class AbstractJDOQLQuery

All Implemented Interfaces:
Serializable, ExecutionContextListener
Direct Known Subclasses:
FederatedJDOQLQuery

public abstract class AbstractJDOQLQuery extends AbstractJavaQuery
Abstract representation of a JDOQL query. The query can be specified via method calls, or via a single-string form.
See Also:
  • Field Details

  • Constructor Details

    • AbstractJDOQLQuery

      public AbstractJDOQLQuery(StoreManager storeMgr, ExecutionContext ec)
      Constructor.
      Parameters:
      storeMgr - StoreManager for this query
      ec - execution context
    • AbstractJDOQLQuery

      public AbstractJDOQLQuery(StoreManager storeMgr, ExecutionContext ec, AbstractJDOQLQuery q)
      Constructs a new query instance having the same criteria as the given query.
      Parameters:
      storeMgr - StoreManager for this query
      ec - execution context
      q - The query from which to copy criteria.
    • AbstractJDOQLQuery

      public AbstractJDOQLQuery(StoreManager storeMgr, ExecutionContext ec, String query)
      Constructor for a JDOQL query where the query is specified using the "Single-String" format.
      Parameters:
      storeMgr - StoreManager for this query
      ec - execution context
      query - The query string
  • Method Details

    • getSupportedExtensions

      public Set<String> getSupportedExtensions()
      Method to return the names of the extensions supported by this query. To be overridden by subclasses where they support additional extensions.
      Overrides:
      getSupportedExtensions in class Query
      Returns:
      The supported extension names
    • setGrouping

      public void setGrouping(String grouping)
      Set the grouping specification for the result Collection.
      Overrides:
      setGrouping in class Query
      Parameters:
      grouping - the grouping specification.
    • setResult

      public void setResult(String result)
      Set the result for the results.
      Overrides:
      setResult in class Query
      Parameters:
      result - Optional keyword "distinct" followed by comma-separated list of result expressions or a result class
    • getQueryCacheKey

      protected String getQueryCacheKey()
      Method to get key for query cache
      Returns:
      The cache key
    • getSingleStringQuery

      public String getSingleStringQuery()
      Method to take the defined parameters for the query and form a single string. This is used to print out the query for logging.
      Specified by:
      getSingleStringQuery in class AbstractJavaQuery
      Returns:
      The single string
    • compileGeneric

      public void compileGeneric(Map parameterValues)
      Description copied from class: AbstractJavaQuery
      Method to generate the generic compilation of this query.
      Specified by:
      compileGeneric in class AbstractJavaQuery
      Parameters:
      parameterValues - Values for any parameters
    • compileInternal

      protected void compileInternal(Map parameterValues)
      Method to compile the JDOQL query. This implementation assumes that we are using the "generic" JDOQL compiler in org.datanucleus.query.compiler. If not then override this method. Will populate the "compilation" class variable.
      Specified by:
      compileInternal in class Query
      Parameters:
      parameterValues - Map of parameter values keyed by parameter name.
    • compileSubqueries

      protected void compileSubqueries(Map<String,Query.SubqueryDefinition> subqueryMap, QueryCompilation parentCompilation, JavaQueryCompiler parentCompiler, Map parameterValues)
      Recursively compile the subqueries
      Parameters:
      subqueryMap - The subquery definition map
      parentCompilation - Parent compilation
      parentCompiler - The parent compiler
      parameterValues - The parameters map
    • getLanguage

      public String getLanguage()
      Accessor for the query language.
      Overrides:
      getLanguage in class Query
      Returns:
      Query language