Class JPQLQuery

  • All Implemented Interfaces:
    Serializable, org.datanucleus.ExecutionContextListener

    public class JPQLQuery
    extends org.datanucleus.store.query.AbstractJPQLQuery
    Implementation of JPQL for MongoDB datastores.
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.datanucleus.store.query.Query

        org.datanucleus.store.query.Query.QueryType, org.datanucleus.store.query.Query.SubqueryDefinition
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected MongoDBQueryCompilation datastoreCompilation
      The compilation of the query for this datastore.
      • Fields inherited from class org.datanucleus.store.query.AbstractJavaQuery

        candidateCollection, singleString
      • Fields inherited from class org.datanucleus.store.query.Query

        candidateClass, candidateClassName, clr, compilation, ec, explicitParameters, explicitVariables, EXTENSION_CHECK_UNUSED_PARAMETERS, EXTENSION_CLOSE_RESULTS_AT_EC_CLOSE, EXTENSION_COMPILATION_CACHED, EXTENSION_EVALUATE_IN_MEMORY, EXTENSION_EXCLUDE_SUBCLASSES, EXTENSION_FLUSH_BEFORE_EXECUTION, EXTENSION_JDOQL_STRICT, EXTENSION_JPQL_STRICT, EXTENSION_LOAD_RESULTS_AT_COMMIT, EXTENSION_QUERY_TYPE, EXTENSION_RESULT_CACHE_TYPE, EXTENSION_RESULT_CACHE_VALIDATE_OBJECTS, EXTENSION_RESULT_SIZE_METHOD, EXTENSION_RESULTS_CACHED, EXTENSION_SQL_SYNTAX_CHECKS, EXTENSION_USE_FETCH_PLAN, extensions, filter, from, fromInclNo, fromInclParam, grouping, having, ignoreCache, implicitParameters, imports, inputParameters, insertFields, insertSelectQuery, LANGUAGE_JDOQL, LANGUAGE_JPQL, LANGUAGE_SQL, ordering, parameterNames, parsedImports, queryResults, range, result, resultClass, resultClassName, resultDistinct, storeMgr, subclasses, subqueries, tasks, toExclNo, toExclParam, type, unique, unmodifiable, update
    • Constructor Summary

      Constructors 
      Constructor Description
      JPQLQuery​(org.datanucleus.store.StoreManager storeMgr, org.datanucleus.ExecutionContext ec)
      Constructs a new query instance that uses the given execution context.
      JPQLQuery​(org.datanucleus.store.StoreManager storeMgr, org.datanucleus.ExecutionContext ec, String query)
      Constructor for a JPQL query where the query is specified using the "Single-String" format.
      JPQLQuery​(org.datanucleus.store.StoreManager storeMgr, org.datanucleus.ExecutionContext ec, JPQLQuery q)
      Constructs a new query instance having the same criteria as the given query.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void compileInternal​(Map parameterValues)
      Method to compile the JDOQL query.
      protected void discardCompiled()
      Utility to remove any previous compilation of this Query.
      protected boolean evaluateInMemory()
      Convenience method to return whether the query should be evaluated in-memory.
      protected boolean isCompiled()
      Method to return if the query is compiled.
      protected Object performExecute​(Map parameters)  
      • Methods inherited from class org.datanucleus.store.query.AbstractJPQLQuery

        compileGeneric, compileSubqueries, getLanguage, getQueryCacheKey, getSingleStringQuery, getSupportedExtensions, resolveClassDeclaration, setResult
      • Methods inherited from class org.datanucleus.store.query.AbstractJavaQuery

        dereferenceFilter, performDeletePersistentAll, setCandidates, setCandidates, toString
      • Methods inherited from class org.datanucleus.store.query.Query

        addExtension, addSubquery, applyImplicitParameterValueToCompilation, applyImplicitParameterValueToSubqueries, assertIsModifiable, assertIsOpen, assertSupportsCancel, cancel, cancel, cancelTaskObject, checkForMissingParameters, checkParameterTypesAgainstCompilation, checkUnusedParameters, close, closeAll, compile, declareExplicitParameters, declareExplicitVariables, declareImports, deepFindSymbolForParameterInCompilation, deletePersistentAll, deletePersistentAll, deletePersistentAll, deregisterTask, equals, execute, executeQuery, executeWithArray, executeWithMap, executionContextClosing, getBooleanExtensionProperty, getCandidateClass, getCandidateClassMetaData, getCandidateClassName, getCompilation, getDatastoreReadTimeoutMillis, getDatastoreWriteTimeoutMillis, getExecutionContext, getExplicitParametersDeclaration, getExplicitVariablesDeclaration, getExtension, getExtensions, getFetchPlan, getFilter, getFrom, getGrouping, getHaving, getIgnoreCache, getImplicitParameters, getImportsDeclaration, getInputParameters, getInsertFields, getInsertSelectQuery, getNativeQuery, getOrdering, getParameterMapForValues, getParsedImports, getQueryManager, getRange, getRangeFromIncl, getRangeFromInclParam, getRangeToExcl, getRangeToExclParam, getResult, getResultClass, getResultClassName, getResultDistinct, getSerializeRead, getStoreManager, getStringExtensionProperty, getSubqueryForVariable, getType, getUpdate, hashCode, hasSubqueryForVariable, isSubclasses, isUnique, isUnmodifiable, prepareDatastore, processesRangeInDatastoreQuery, registerTask, setCacheResults, setCandidateClass, setCandidateClassName, setCompilation, setDatastoreReadTimeoutMillis, setDatastoreWriteTimeoutMillis, setExtensions, setFetchPlan, setFilter, setFrom, setGrouping, setHaving, setIgnoreCache, setImplicitParameter, setImplicitParameter, setInsertFields, setInsertSelectQuery, setOrdering, setRange, setRange, setResultClass, setResultClassName, setResultDistinct, setResultMetaData, setSerializeRead, setSubclasses, setType, setUnique, setUnmodifiable, setUpdate, shouldReturnSingleRow, supportsTimeout, useCaching, useFetchPlan, useResultsCaching
    • Field Detail

      • datastoreCompilation

        protected transient MongoDBQueryCompilation datastoreCompilation
        The compilation of the query for this datastore. Not applicable if totally in-memory.
    • Constructor Detail

      • JPQLQuery

        public JPQLQuery​(org.datanucleus.store.StoreManager storeMgr,
                         org.datanucleus.ExecutionContext ec)
        Constructs a new query instance that uses the given execution context.
        Parameters:
        storeMgr - StoreManager for this query
        ec - Execution Context
      • JPQLQuery

        public JPQLQuery​(org.datanucleus.store.StoreManager storeMgr,
                         org.datanucleus.ExecutionContext ec,
                         JPQLQuery 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.
      • JPQLQuery

        public JPQLQuery​(org.datanucleus.store.StoreManager storeMgr,
                         org.datanucleus.ExecutionContext ec,
                         String query)
        Constructor for a JPQL 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 Detail

      • discardCompiled

        protected void discardCompiled()
        Utility to remove any previous compilation of this Query.
        Overrides:
        discardCompiled in class org.datanucleus.store.query.AbstractJavaQuery
      • isCompiled

        protected boolean isCompiled()
        Method to return if the query is compiled.
        Overrides:
        isCompiled in class org.datanucleus.store.query.Query
        Returns:
        Whether it is compiled
      • evaluateInMemory

        protected boolean evaluateInMemory()
        Convenience method to return whether the query should be evaluated in-memory.
        Overrides:
        evaluateInMemory in class org.datanucleus.store.query.AbstractJavaQuery
        Returns:
        Use in-memory evaluation?
      • compileInternal

        protected void compileInternal​(Map parameterValues)
        Method to compile the JDOQL query. Uses the superclass to compile the generic query populating the "compilation", and then generates the datastore-specific "datastoreCompilation".
        Overrides:
        compileInternal in class org.datanucleus.store.query.AbstractJPQLQuery
        Parameters:
        parameterValues - Map of param values keyed by param name (if available at compile time)
      • performExecute

        protected Object performExecute​(Map parameters)
        Specified by:
        performExecute in class org.datanucleus.store.query.Query