Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa

public Class JPAQuery

extends DatabaseQuery
Class Inheritance
Imports
org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.exceptions.DatabaseException, .OptimisticLockException, org.eclipse.persistence.internal.helper.DatabaseField, org.eclipse.persistence.internal.sessions.AbstractSession, java.util.ArrayList, .List, .Map, jakarta.persistence.LockModeType, org.eclipse.persistence.queries.DatabaseQuery, .EntityResult, .SQLResultSetMapping, .StoredProcedureCall, org.eclipse.persistence.sessions.Session

Purpose: A JPA placeholder Query object to store JPQL strings so that processing the string is delayed until Login.
Author
Chris Delahunt
Since
TopLink Essentials

Field Summary

Modifier and TypeField and Description
private StoredProcedureCall
private Map<String, Object>
private String
private String
private String
private List<String>
private List<String>
private String
Inherited from org.eclipse.persistence.queries.DatabaseQuery:
accessorsallowNativeSQLQueryargumentFieldsargumentParameterTypesargumentsargumentTypeNamesargumentTypesargumentValuesBATCH_FETCH_PROPERTYCascadeAggregateDeleteCascadeAllPartsCascadeByMappingCascadeDependentPartscascadePolicyCascadePrivatePartsdescriptordescriptorsdoNotRedirectexecutionSessionflushOnExecutehintStringisCustomQueryUsedisExecutionCloneisNativeConnectionRequiredisPreparedisUserDefinedisUserDefinedSQLCallmonitorNamenameNoCascadingnullableArgumentsparameterDelimiterpartitioningPolicypropertiesqueryMechanismqueryTimeoutqueryTimeoutUnitredirectorsessionsessionNameshouldBindAllParametersshouldCacheStatementshouldCloneCallshouldMaintainCacheshouldPrepareshouldRetrieveBypassCacheshouldReturnGeneratedKeysshouldStoreBypassCacheshouldUseWrapperPolicyshouldValidateUpdateCallCacheUsesourceMappingtranslationRow

Constructor Summary

AccessConstructor and Description
public
public
JPAQuery(String jpqlString)

public
JPAQuery(String name, String jpqlString, String lockMode, Map<String, Object> hints)

JPQL

public
JPAQuery(String queryName, String sqlString, Map<String, Object> hints)

public
JPAQuery(String queryName, StoredProcedureCall call, Map<String, Object> hints)

Method Summary

Modifier and TypeMethod and Description
public void
public void
addResultSetMapping(String resultSetMapping)

public Object
executeDatabaseQuery()

Implements abstract org.eclipse.persistence.queries.DatabaseQuery.executeDatabaseQuery.

INTERNAL: This should never be called and is only here because it is needed as an extension to DatabaseQuery.
public DatabaseQuery
public List<ClassDescriptor>
getDescriptors()

Overrides org.eclipse.persistence.queries.DatabaseQuery.getDescriptors.

INTERNAL: For table per tenant queries the descriptor list will extracted from parsing the jpql query and cached here.
public Map<String, Object>
getHints()

Return the JPA query hints.

public String
public boolean
isJPQLQuery()

Return true if this query is a jpql query.

public boolean
isSQLQuery()

Return true if this query is an sql query.

public void
prepare()

Overrides org.eclipse.persistence.queries.DatabaseQuery.prepare.

INTERNAL: Generate the DatabaseQuery query from the JPA named query.
public DatabaseQuery
processJPQLQuery(Session session)

INTERNAL: Convert the JPA query into a DatabaseQuery.

public DatabaseQuery
processSQLQuery(Session session)

INTERNAL: Convert the SQL string into a DatabaseQuery.

public DatabaseQuery
processStoredProcedureQuery(Session session)

INTERNAL: Convert the StoredProc call into a DatabaseQuery.

public void
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.

public void
public void
setJPQLString(String jpqlString)

Overrides org.eclipse.persistence.queries.DatabaseQuery.setJPQLString.

PUBLIC: Set the JPQL string of the query.
public void
public void
setResultSetMappings(List<String> resultSetMappings)

Inherited from org.eclipse.persistence.queries.DatabaseQuery:
addArgumentaddArgumentaddArgumentaddArgumentaddArgumentaddArgumentaddArgumentByTypeNameaddArgumentValueaddArgumentValuesaddCalladdStatementbindAllParametersbuildArgumentFieldsbuildSelectionCriteriacacheStatementcascadeAllPartscascadeByMappingcascadeOnlyDependentPartscascadePrivatePartscheckDescriptorcheckEarlyReturncheckForCustomQuerycheckPreparecheckPreparecloneclonedQueryExecutionCompleteconvertClassNamesToClassescopyFromQuerydontBindAllParametersdontCacheStatementdontCascadePartsdontMaintainCacheexecuteexecuteInUnitOfWorkextractRemoteResultgetAccessorgetAccessorsgetArgumentParameterTypesgetArgumentsgetArgumentTypeNamesgetArgumentTypesgetArgumentValuesgetBatchObjectsgetCallgetCascadePolicygetDatasourceCallgetDatasourceCallsgetDefaultRedirectorgetDescriptorgetDomainClassNounNamegetDoNotRedirectgetEJBQLStringgetExecutionSessiongetFlushOnExecutegetHintStringgetMonitorNamegetNamegetNullableArgumentsgetParameterDelimitergetParameterDelimiterChargetPartitioningPolicygetPropertiesgetPropertygetQueryMechanismgetQueryNounNamegetQueryTimeoutgetQueryTimeoutUnitgetRedirectorgetRedirectorForQuerygetReferenceClassgetReferenceClassNamegetSelectionCriteriagetSensorNamegetSessiongetSessionNamegetShouldBindAllParametersgetSourceMappinggetSQLStatementgetSQLStringgetSQLStringsgetTranslatedSQLStringgetTranslatedSQLStringsgetTranslationRowhasAccessorhasArgumentshasNullableArgumentshasPropertieshasQueryMechanismhasSessionNameignoreBindAllParametersignoreCacheStatementisCallQueryisCascadeOfAggregateDeleteisCustomQueryUsedisCustomSelectionQueryisDataModifyQueryisDataReadQueryisDefaultPropertiesQueryisDeleteAllQueryisDeleteObjectQueryisDirectReadQueryisExecutionCloneisExpressionQueryisInsertObjectQueryisJPQLCallQueryisModifyAllQueryisModifyQueryisNativeConnectionRequiredisObjectBuildingQueryisObjectLevelModifyQueryisObjectLevelReadQueryisPreparedisReadAllQueryisReadObjectQueryisReadQueryisReportQueryisResultSetMappingQueryisSQLCallQueryisUpdateAllQueryisUpdateObjectQueryisUserDefinedisUserDefinedSQLCallisValueReadQueryisWriteObjectQuerymaintainCacheprepareCallprepareCustomQueryprepareForExecutionprepareForRemoteExecutionprepareFromQueryprepareInternalredirectQueryremoteExecuteremoteExecuteremovePropertyreplaceValueHoldersInresetMonitorNameretrieveBypassCacherowFromArgumentssetAccessorsetAccessorssetAllowNativeSQLQuerysetArgumentssetArgumentTypeNamessetArgumentTypessetArgumentValuessetBatchObjectssetCallsetCascadePolicysetDatasourceCallsetDescriptorsetDoNotRedirectsetEJBQLStringsetExecutionSessionsetFlushOnExecutesetHintStringsetIsCustomQueryUsedsetIsExecutionClonesetIsNativeConnectionRequiredsetIsPreparedsetIsUserDefinedsetIsUserDefinedSQLCallsetNamesetNullableArgumentssetParameterDelimitersetPartitioningPolicysetPropertiessetPropertysetQueryMechanismsetQueryTimeoutsetQueryTimeoutUnitsetRedirectorsetSelectionCriteriasetSessionsetSessionNamesetShouldBindAllParameterssetShouldBindAllParameterssetShouldCacheStatementsetShouldMaintainCachesetShouldPreparesetShouldRetrieveBypassCachesetShouldReturnGeneratedKeyssetShouldStoreBypassCachesetShouldUseWrapperPolicysetShouldValidateUpdateCallCacheUsesetSourceMappingsetSQLStatementsetSQLStringsetTranslationRowshouldAllowNativeSQLQueryshouldBindAllParametersshouldCacheStatementshouldCascadeAllPartsshouldCascadeByMappingshouldCascadeOnlyDependentPartsshouldCascadePartsshouldCascadePrivatePartsshouldCloneCallshouldIgnoreBindAllParametersshouldIgnoreCacheStatementshouldMaintainCacheshouldPrepareshouldPrepareshouldRetrieveBypassCacheshouldReturnGeneratedKeysshouldStoreBypassCacheshouldUseWrapperPolicyshouldValidateUpdateCallCacheUsestoreBypassCachetoString

Field Detail

callback to summary
private StoredProcedureCall call
hintsback to summary
private Map<String, Object> hints
jpqlStringback to summary
private String jpqlString
lockModeback to summary
private String lockMode
resultClassNameback to summary
private String resultClassName
resultClassNamesback to summary
private List<String> resultClassNames
resultSetMappingNamesback to summary
private List<String> resultSetMappingNames
sqlStringback to summary
private String sqlString

Constructor Detail

JPAQueryback to summary
public JPAQuery()
JPAQueryback to summary
public JPAQuery(String jpqlString)
JPAQueryback to summary
public JPAQuery(String name, String jpqlString, String lockMode, Map<String, Object> hints)

JPQL

JPAQueryback to summary
public JPAQuery(String queryName, String sqlString, Map<String, Object> hints)
JPAQueryback to summary
public JPAQuery(String queryName, StoredProcedureCall call, Map<String, Object> hints)

Method Detail

addResultClassNamesback to summary
public void addResultClassNames(String className)
addResultSetMappingback to summary
public void addResultSetMapping(String resultSetMapping)
executeDatabaseQueryback to summary
public Object executeDatabaseQuery() throws DatabaseException, OptimisticLockException

Implements abstract org.eclipse.persistence.queries.DatabaseQuery.executeDatabaseQuery.

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.

Returns:Object

Doc from org.eclipse.persistence.queries.DatabaseQuery.executeDatabaseQuery.

- the result of executing the query.

Annotations
@Override
Exceptions
DatabaseException:

Doc from org.eclipse.persistence.queries.DatabaseQuery.executeDatabaseQuery.

- an error has occurred on the database.

OptimisticLockException:

Doc from org.eclipse.persistence.queries.DatabaseQuery.executeDatabaseQuery.

- an error has occurred using the optimistic lock feature.

getDatabaseQueryback to summary
public DatabaseQuery getDatabaseQuery()
getDescriptorsback to summary
public List<ClassDescriptor> getDescriptors()

Overrides org.eclipse.persistence.queries.DatabaseQuery.getDescriptors.

INTERNAL: For table per tenant queries the descriptor list will extracted from parsing the jpql query and cached here.

Annotations
@Override
getHintsback to summary
public Map<String, Object> getHints()

Return the JPA query hints.

getJPQLStringback to summary
public String getJPQLString()

Overrides org.eclipse.persistence.queries.DatabaseQuery.getJPQLString.

Return the JPQL string.

Annotations
@Override
isJPQLQueryback to summary
public boolean isJPQLQuery()

Return true if this query is a jpql query.

isSQLQueryback to summary
public boolean isSQLQuery()

Return true if this query is an sql query.

prepareback to summary
public void prepare()

Overrides org.eclipse.persistence.queries.DatabaseQuery.prepare.

INTERNAL: Generate the DatabaseQuery query from the JPA named query.

Annotations
@Override
processJPQLQueryback to summary
public DatabaseQuery processJPQLQuery(Session session)

INTERNAL: Convert the JPA query into a DatabaseQuery.

processSQLQueryback to summary
public DatabaseQuery processSQLQuery(Session session)

INTERNAL: Convert the SQL string into a DatabaseQuery.

processStoredProcedureQueryback to summary
public DatabaseQuery processStoredProcedureQuery(Session session)

INTERNAL: Convert the StoredProc call into a DatabaseQuery.

setDatabaseQueryback to summary
public void setDatabaseQuery(DatabaseQuery databaseQuery)
setDescriptorsback to summary
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.

setHintsback to summary
public void setHints(Map<String, Object> hints)
setJPQLStringback to summary
public void setJPQLString(String jpqlString)

Overrides org.eclipse.persistence.queries.DatabaseQuery.setJPQLString.

Doc from org.eclipse.persistence.queries.DatabaseQuery.setJPQLString.

PUBLIC: Set the JPQL string of the query. If arguments are required in the string they will be preceded by ":" then the argument name. The JPQL arguments must also be added as argument to the query.

Annotations
@Override
setResultClassNameback to summary
public void setResultClassName(String className)
setResultSetMappingsback to summary
public void setResultSetMappings(List<String> resultSetMappings)