Class JPAQuery

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.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
    • Constructor Summary

      Constructors 
      Constructor Description
      JPAQuery()  
      JPAQuery​(java.lang.String jpqlString)  
      JPAQuery​(java.lang.String name, java.lang.String jpqlString, java.lang.String lockMode, java.util.Map<java.lang.String,​java.lang.Object> hints)
      JPQL
      JPAQuery​(java.lang.String queryName, java.lang.String sqlString, java.util.Map<java.lang.String,​java.lang.Object> hints)  
      JPAQuery​(java.lang.String queryName, org.eclipse.persistence.queries.StoredProcedureCall call, java.util.Map<java.lang.String,​java.lang.Object> hints)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addResultClassNames​(java.lang.String className)  
      void addResultSetMapping​(java.lang.String resultSetMapping)  
      java.lang.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()  
      java.util.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.
      java.util.Map<java.lang.String,​java.lang.Object> getHints()
      Return the JPA query hints.
      java.lang.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​(java.util.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​(java.util.Map<java.lang.String,​java.lang.Object> hints)  
      void setJPQLString​(java.lang.String jpqlString)  
      void setResultClassName​(java.lang.String className)  
      void setResultSetMappings​(java.util.List<java.lang.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
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • JPAQuery

        public JPAQuery()
      • JPAQuery

        public JPAQuery​(java.lang.String jpqlString)
      • JPAQuery

        public JPAQuery​(java.lang.String name,
                        java.lang.String jpqlString,
                        java.lang.String lockMode,
                        java.util.Map<java.lang.String,​java.lang.Object> hints)
        JPQL
        Parameters:
        name -
        jpqlString -
        lockMode -
        hints -
      • JPAQuery

        public JPAQuery​(java.lang.String queryName,
                        java.lang.String sqlString,
                        java.util.Map<java.lang.String,​java.lang.Object> hints)
      • JPAQuery

        public JPAQuery​(java.lang.String queryName,
                        org.eclipse.persistence.queries.StoredProcedureCall call,
                        java.util.Map<java.lang.String,​java.lang.Object> hints)
    • Method Detail

      • addResultClassNames

        public void addResultClassNames​(java.lang.String className)
      • addResultSetMapping

        public void addResultSetMapping​(java.lang.String resultSetMapping)
      • executeDatabaseQuery

        public java.lang.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 java.util.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 java.util.Map<java.lang.String,​java.lang.Object> getHints()
        Return the JPA query hints.
      • getJPQLString

        public java.lang.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​(java.util.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.
      • setHints

        public void setHints​(java.util.Map<java.lang.String,​java.lang.Object> hints)
      • setJPQLString

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

        public void setResultClassName​(java.lang.String className)
      • setResultSetMappings

        public void setResultSetMappings​(java.util.List<java.lang.String> resultSetMappings)