Class JPAQuery

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class JPAQuery
    extends org.eclipse.persistence.queries.DatabaseQuery
    Purpose: A JPA placeholder Query object to store JPQL strings so that processing the string is delayed until Login.
    Since:
    TopLink Essentials
    Author:
    Chris Delahunt
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.eclipse.persistence.queries.DatabaseQuery

        org.eclipse.persistence.queries.DatabaseQuery.ParameterType
    • Field Summary

      • Fields inherited from class org.eclipse.persistence.queries.DatabaseQuery

        accessors, allowNativeSQLQuery, argumentFields, argumentParameterTypes, arguments, argumentTypeNames, argumentTypes, argumentValues, BATCH_FETCH_PROPERTY, CascadeAggregateDelete, CascadeAllParts, CascadeByMapping, CascadeDependentParts, cascadePolicy, CascadePrivateParts, descriptor, descriptors, doNotRedirect, executionSession, flushOnExecute, hintString, isCustomQueryUsed, isExecutionClone, isNativeConnectionRequired, isPrepared, isUserDefined, isUserDefinedSQLCall, monitorName, name, NoCascading, nullableArguments, parameterDelimiter, partitioningPolicy, properties, queryMechanism, queryTimeout, queryTimeoutUnit, redirector, session, sessionName, shouldBindAllParameters, shouldCacheStatement, shouldCloneCall, shouldMaintainCache, shouldPrepare, shouldRetrieveBypassCache, shouldReturnGeneratedKeys, shouldStoreBypassCache, shouldUseWrapperPolicy, shouldValidateUpdateCallCacheUse, sourceMapping, translationRow
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addResultClassNames​(String className)  
      void addResultSetMapping​(String resultSetMapping)  
      Object executeDatabaseQuery()
      INTERNAL: This should never be called and is only here because it is needed as an extension to DatabaseQuery.
      org.eclipse.persistence.queries.DatabaseQuery getDatabaseQuery()  
      List<org.eclipse.persistence.descriptors.ClassDescriptor> getDescriptors()
      INTERNAL: For table per tenant queries the descriptor list will extracted from parsing the jpql query and cached here.
      Map<String,​Object> getHints()
      Return the JPA query hints.
      String getJPQLString()
      Return the JPQL string.
      boolean isJPQLQuery()
      Return true if this query is a jpql query.
      boolean isSQLQuery()
      Return true if this query is an sql query.
      void prepare()
      INTERNAL: Generate the DatabaseQuery query from the JPA named query.
      org.eclipse.persistence.queries.DatabaseQuery processJPQLQuery​(org.eclipse.persistence.sessions.Session session)
      INTERNAL: Convert the JPA query into a DatabaseQuery.
      org.eclipse.persistence.queries.DatabaseQuery processSQLQuery​(org.eclipse.persistence.sessions.Session session)
      INTERNAL: Convert the SQL string into a DatabaseQuery.
      org.eclipse.persistence.queries.DatabaseQuery processStoredProcedureQuery​(org.eclipse.persistence.sessions.Session session)
      INTERNAL: Convert the StoredProc call into a DatabaseQuery.
      void setDatabaseQuery​(org.eclipse.persistence.queries.DatabaseQuery databaseQuery)  
      void setDescriptors​(List<org.eclipse.persistence.descriptors.ClassDescriptor> descriptors)
      INTERNAL: For table per tenant queries the descriptor list will extracted from parsing the jpql query and cached here.
      void setHints​(Map<String,​Object> hints)  
      void setJPQLString​(String jpqlString)  
      void setResultClassName​(String className)  
      void setResultSetMappings​(List<String> resultSetMappings)  
      • Methods inherited from class org.eclipse.persistence.queries.DatabaseQuery

        addArgument, addArgument, addArgument, addArgument, addArgument, addArgument, addArgumentByTypeName, addArgumentValue, addArgumentValues, addCall, addStatement, bindAllParameters, buildArgumentFields, buildSelectionCriteria, cacheStatement, cascadeAllParts, cascadeByMapping, cascadeOnlyDependentParts, cascadePrivateParts, checkDescriptor, checkEarlyReturn, checkForCustomQuery, checkPrepare, checkPrepare, clone, clonedQueryExecutionComplete, convertClassNamesToClasses, copyFromQuery, dontBindAllParameters, dontCacheStatement, dontCascadeParts, dontMaintainCache, execute, executeInUnitOfWork, extractRemoteResult, getAccessor, getAccessors, getArgumentParameterTypes, getArguments, getArgumentTypeNames, getArgumentTypes, getArgumentValues, getBatchObjects, getCall, getCascadePolicy, getDatasourceCall, getDatasourceCalls, getDefaultRedirector, getDescriptor, getDomainClassNounName, getDoNotRedirect, getEJBQLString, getExecutionSession, getFlushOnExecute, getHintString, getMonitorName, getName, getNullableArguments, getParameterDelimiter, getParameterDelimiterChar, getPartitioningPolicy, getProperties, getProperty, getQueryMechanism, getQueryNounName, getQueryTimeout, getQueryTimeoutUnit, getRedirector, getRedirectorForQuery, getReferenceClass, getReferenceClassName, getSelectionCriteria, getSensorName, getSession, getSessionName, getShouldBindAllParameters, getSourceMapping, getSQLStatement, getSQLString, getSQLStrings, getTranslatedSQLString, getTranslatedSQLStrings, getTranslationRow, hasAccessor, hasArguments, hasNullableArguments, hasProperties, hasQueryMechanism, hasSessionName, ignoreBindAllParameters, ignoreCacheStatement, isCallQuery, isCascadeOfAggregateDelete, isCustomQueryUsed, isCustomSelectionQuery, isDataModifyQuery, isDataReadQuery, isDefaultPropertiesQuery, isDeleteAllQuery, isDeleteObjectQuery, isDirectReadQuery, isExecutionClone, isExpressionQuery, isInsertObjectQuery, isJPQLCallQuery, isModifyAllQuery, isModifyQuery, isNativeConnectionRequired, isObjectBuildingQuery, isObjectLevelModifyQuery, isObjectLevelReadQuery, isPrepared, isReadAllQuery, isReadObjectQuery, isReadQuery, isReportQuery, isResultSetMappingQuery, isSQLCallQuery, isUpdateAllQuery, isUpdateObjectQuery, isUserDefined, isUserDefinedSQLCall, isValueReadQuery, isWriteObjectQuery, maintainCache, prepareCall, prepareCustomQuery, prepareForExecution, prepareForRemoteExecution, prepareFromQuery, prepareInternal, redirectQuery, remoteExecute, remoteExecute, removeProperty, replaceValueHoldersIn, resetMonitorName, retrieveBypassCache, rowFromArguments, setAccessor, setAccessors, setAllowNativeSQLQuery, setArguments, setArgumentTypeNames, setArgumentTypes, setArgumentValues, setBatchObjects, setCall, setCascadePolicy, setDatasourceCall, setDescriptor, setDoNotRedirect, setEJBQLString, setExecutionSession, setFlushOnExecute, setHintString, setIsCustomQueryUsed, setIsExecutionClone, setIsNativeConnectionRequired, setIsPrepared, setIsUserDefined, setIsUserDefinedSQLCall, setName, setNullableArguments, setParameterDelimiter, setPartitioningPolicy, setProperties, setProperty, setQueryMechanism, setQueryTimeout, setQueryTimeoutUnit, setRedirector, setSelectionCriteria, setSession, setSessionName, setShouldBindAllParameters, setShouldBindAllParameters, setShouldCacheStatement, setShouldMaintainCache, setShouldPrepare, setShouldRetrieveBypassCache, setShouldReturnGeneratedKeys, setShouldStoreBypassCache, setShouldUseWrapperPolicy, setShouldValidateUpdateCallCacheUse, setSourceMapping, setSQLStatement, setSQLString, setTranslationRow, shouldAllowNativeSQLQuery, shouldBindAllParameters, shouldCacheStatement, shouldCascadeAllParts, shouldCascadeByMapping, shouldCascadeOnlyDependentParts, shouldCascadeParts, shouldCascadePrivateParts, shouldCloneCall, shouldIgnoreBindAllParameters, shouldIgnoreCacheStatement, shouldMaintainCache, shouldPrepare, shouldPrepare, shouldRetrieveBypassCache, shouldReturnGeneratedKeys, shouldStoreBypassCache, shouldUseWrapperPolicy, shouldValidateUpdateCallCacheUse, storeBypassCache, toString
    • Method Detail

      • addResultClassNames

        public void addResultClassNames​(String className)
      • addResultSetMapping

        public void addResultSetMapping​(String resultSetMapping)
      • executeDatabaseQuery

        public Object executeDatabaseQuery()
                                    throws org.eclipse.persistence.exceptions.DatabaseException,
                                           org.eclipse.persistence.exceptions.OptimisticLockException
        INTERNAL: This should never be called and is only here because it is needed as an extension to DatabaseQuery. Perhaps exception should be thrown to warn users, but for now it will execute the resulting query instead, this allows JPA style queries to be executed on a normal EclipseLink Session.
        Specified by:
        executeDatabaseQuery in class org.eclipse.persistence.queries.DatabaseQuery
        Throws:
        org.eclipse.persistence.exceptions.DatabaseException
        org.eclipse.persistence.exceptions.OptimisticLockException
      • getDatabaseQuery

        public org.eclipse.persistence.queries.DatabaseQuery getDatabaseQuery()
      • getDescriptors

        public List<org.eclipse.persistence.descriptors.ClassDescriptor> getDescriptors()
        INTERNAL: For table per tenant queries the descriptor list will extracted from parsing the jpql query and cached here.
        Overrides:
        getDescriptors in class org.eclipse.persistence.queries.DatabaseQuery
      • getHints

        public Map<String,​Object> getHints()
        Return the JPA query hints.
      • getJPQLString

        public String getJPQLString()
        Return the JPQL string.
        Overrides:
        getJPQLString in class org.eclipse.persistence.queries.DatabaseQuery
      • isJPQLQuery

        public boolean isJPQLQuery()
        Return true if this query is a jpql query.
      • isSQLQuery

        public boolean isSQLQuery()
        Return true if this query is an sql query.
      • prepare

        public void prepare()
        INTERNAL: Generate the DatabaseQuery query from the JPA named query.
        Overrides:
        prepare in class org.eclipse.persistence.queries.DatabaseQuery
      • processJPQLQuery

        public org.eclipse.persistence.queries.DatabaseQuery processJPQLQuery​(org.eclipse.persistence.sessions.Session session)
        INTERNAL: Convert the JPA query into a DatabaseQuery.
      • processSQLQuery

        public org.eclipse.persistence.queries.DatabaseQuery processSQLQuery​(org.eclipse.persistence.sessions.Session session)
        INTERNAL: Convert the SQL string into a DatabaseQuery.
      • processStoredProcedureQuery

        public org.eclipse.persistence.queries.DatabaseQuery processStoredProcedureQuery​(org.eclipse.persistence.sessions.Session session)
        INTERNAL: Convert the StoredProc call into a DatabaseQuery.
      • setDatabaseQuery

        public void setDatabaseQuery​(org.eclipse.persistence.queries.DatabaseQuery databaseQuery)
      • setDescriptors

        public void setDescriptors​(List<org.eclipse.persistence.descriptors.ClassDescriptor> descriptors)
        INTERNAL: For table per tenant queries the descriptor list will extracted from parsing the jpql query and cached here.
      • setJPQLString

        public void setJPQLString​(String jpqlString)
        Overrides:
        setJPQLString in class org.eclipse.persistence.queries.DatabaseQuery
      • setResultClassName

        public void setResultClassName​(String className)
      • setResultSetMappings

        public void setResultSetMappings​(List<String> resultSetMappings)