- java.lang.Object
-
- org.eclipse.persistence.queries.DatabaseQuery
-
- org.eclipse.persistence.internal.jpa.JPAQuery
-
- All Implemented Interfaces:
Serializable,Cloneable
public class JPAQuery extends 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
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(String jpqlString)JPAQuery(String name, String jpqlString, String lockMode, Map<String,Object> hints)JPQLJPAQuery(String queryName, String sqlString, Map<String,Object> hints)JPAQuery(String queryName, StoredProcedureCall call, Map<String,Object> hints)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddResultClassNames(String className)voidaddResultSetMapping(String resultSetMapping)ObjectexecuteDatabaseQuery()INTERNAL: This should never be called and is only here because it is needed as an extension to DatabaseQuery.DatabaseQuerygetDatabaseQuery()List<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.StringgetJPQLString()Return the JPQL string.booleanisJPQLQuery()Return true if this query is a jpql query.booleanisSQLQuery()Return true if this query is an sql query.voidprepare()INTERNAL: Generate the DatabaseQuery query from the JPA named query.DatabaseQueryprocessJPQLQuery(Session session)INTERNAL: Convert the JPA query into a DatabaseQuery.DatabaseQueryprocessSQLQuery(Session session)INTERNAL: Convert the SQL string into a DatabaseQuery.DatabaseQueryprocessStoredProcedureQuery(Session session)INTERNAL: Convert the StoredProc call into a DatabaseQuery.voidsetDatabaseQuery(DatabaseQuery databaseQuery)voidsetDescriptors(List<ClassDescriptor> descriptors)INTERNAL: For table per tenant queries the descriptor list will extracted from parsing the jpql query and cached here.voidsetHints(Map<String,Object> hints)voidsetJPQLString(String jpqlString)voidsetResultClassName(String className)voidsetResultSetMappings(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 DatabaseException, 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:
executeDatabaseQueryin classDatabaseQuery- Throws:
DatabaseExceptionOptimisticLockException
-
getDatabaseQuery
public DatabaseQuery getDatabaseQuery()
-
getDescriptors
public List<ClassDescriptor> getDescriptors()
INTERNAL: For table per tenant queries the descriptor list will extracted from parsing the jpql query and cached here.- Overrides:
getDescriptorsin classDatabaseQuery
-
getJPQLString
public String getJPQLString()
Return the JPQL string.- Overrides:
getJPQLStringin classDatabaseQuery
-
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:
preparein classDatabaseQuery
-
processJPQLQuery
public DatabaseQuery processJPQLQuery(Session session)
INTERNAL: Convert the JPA query into a DatabaseQuery.
-
processSQLQuery
public DatabaseQuery processSQLQuery(Session session)
INTERNAL: Convert the SQL string into a DatabaseQuery.
-
processStoredProcedureQuery
public DatabaseQuery processStoredProcedureQuery(Session session)
INTERNAL: Convert the StoredProc call into a DatabaseQuery.
-
setDatabaseQuery
public void setDatabaseQuery(DatabaseQuery databaseQuery)
-
setDescriptors
public void setDescriptors(List<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:
setJPQLStringin classDatabaseQuery
-
setResultClassName
public void setResultClassName(String className)
-
-