Class DatabaseQuery
- java.lang.Object
-
- org.eclipse.persistence.queries.DatabaseQuery
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
DoesExistQuery,ModifyQuery,ReadQuery
public abstract class DatabaseQuery extends java.lang.Object implements java.lang.Cloneable, java.io.SerializablePurpose: Abstract class for all database query objects. DatabaseQuery is a visible class to the EclipseLink user. Users create an appropriate query by creating an instance of a concrete subclasses of DatabaseQuery.
Responsibilities:
- Provide a common protocol for query objects.
- Defines a generic execution interface.
- Provides query property values
- Holds arguments to the query
- See Also:
- Serialized Form
- Author:
- Yvon Lavoie
- Since:
- TOPLink/Java 1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDatabaseQuery.ParameterTypeUsed for parameter retreival in JPQL
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Collection<org.eclipse.persistence.internal.databaseaccess.Accessor>accessorsConnection to use for database access, required for server session connection pooling.protected java.lang.BooleanallowNativeSQLQueryProperty used to override a persistence unit level that disallows native SQL queries.protected java.util.List<org.eclipse.persistence.internal.helper.DatabaseField>argumentFieldsPERF: Argument fields are cached in prepare to avoid rebuilding on each execution.protected java.util.List<DatabaseQuery.ParameterType>argumentParameterTypesprotected java.util.List<java.lang.String>argumentsArguments can be given and specified to predefined queries to allow reuse.protected java.util.List<java.lang.String>argumentTypeNamesUsed to build a list of argumentTypes by name pre-initializationprotected java.util.List<java.lang.Class>argumentTypesNeeded to differentiate queries with the same name.protected java.util.List<java.lang.Object>argumentValuesArguments values can be given and specified to predefined queries to allow reuse.static java.lang.StringBATCH_FETCH_PROPERTYINTERNAL: Property used for batch fetching in non object queries.static intCascadeAggregateDeletestatic intCascadeAllPartsstatic intCascadeByMappingstatic intCascadeDependentPartsprotected intcascadePolicyPolicy that determines how the query will cascade to its object's parts.static intCascadePrivatePartsprotected ClassDescriptordescriptorThe descriptor cached on the prepare for object level queries.protected java.util.List<ClassDescriptor>descriptorsThe list of descriptors this query deals with.protected booleandoNotRedirectCan be set to true in the case there is a redirector or a default redirector but the user does not want the query redirected.protected org.eclipse.persistence.internal.sessions.AbstractSessionexecutionSessionOnly used after the query is cloned for execution to store the execution session under which the query was executed.protected java.lang.BooleanflushOnExecuteprotected java.lang.StringhintStringUsed for adding hints to the query string in oracleprotected java.lang.BooleanisCustomQueryUsedPERF: Store if this query will use the descriptor custom query.protected booleanisExecutionClonePERF: Determines if the query has already been cloned for execution, to avoid duplicate cloning.protected booleanisNativeConnectionRequiredAllow connection unwrapping to be configured.protected booleanisPreparedQueries prepare common stated in themselves.protected booleanisUserDefinedInternal flag used to bypass user define queries when executing one for custom sql/query support.protected booleanisUserDefinedSQLCallInternal flag used to bypass user define queries when executing one for custom sql/query support.protected java.lang.StringmonitorNameReturn the name to use for the query in performance monitoring.protected java.lang.StringnameQueries can be given a name and registered with a descriptor to allow common queries to be reused.static intNoCascadingprotected java.util.List<org.eclipse.persistence.internal.helper.DatabaseField>nullableArgumentsList of arguments to check for null.protected java.lang.StringparameterDelimiterAllow the reserved pound char used to delimit bind parameters to be overriddenprotected PartitioningPolicypartitioningPolicyAllow queries to be targeted at specific connection pools.protected java.util.Map<java.lang.Object,java.lang.Object>propertiesInternally used by the mappings as a temporary store.protected org.eclipse.persistence.internal.queries.DatabaseQueryMechanismqueryMechanismThe query mechanism determines the mechanism on how the database will be accessed.protected intqueryTimeoutqueryTimeout has three possible settings: DefaultTimeout, NoTimeout, and 1..N This applies to both DatabaseQuery.queryTimeout and DescriptorQueryManager.queryTimeout DatabaseQuery.queryTimeout: - DefaultTimeout: get queryTimeout from DescriptorQueryManager - NoTimeout, 1..N: overrides queryTimeout in DescriptorQueryManager DescriptorQueryManager.queryTimeout: - DefaultTimeout: get queryTimeout from parent DescriptorQueryManager.protected java.util.concurrent.TimeUnitqueryTimeoutUnitprotected QueryRedirectorredirectorA redirector allows for a queries execution to be the execution of a piece of code.protected org.eclipse.persistence.internal.sessions.AbstractSessionsessionOnly used after the query is cloned for execution to store the session under which the query was executed.protected java.lang.StringsessionNameUsed to override the default session in the session broker.protected java.lang.BooleanshouldBindAllParametersBind all arguments to the SQL statement.protected java.lang.BooleanshouldCacheStatementCache the prepared statement, this requires full parameter binding as well.protected booleanshouldCloneCallUsed to indicate whether or not the call needs to be cloned.protected booleanshouldMaintainCacheFlag used for a query to bypass the identitymap and unit of work.protected booleanshouldPrepareAllow for the prepare of queries to be turned off, this allow for dynamic non-pre SQL generated queries.protected booleanshouldRetrieveBypassCacheJPA flags to control the shared cacheprotected booleanshouldReturnGeneratedKeysprotected booleanshouldStoreBypassCacheprotected booleanshouldUseWrapperPolicyUse the WrapperPolicy for the objects returned by the queryprotected booleanshouldValidateUpdateCallCacheUseAllow additional validation to be performed before using the update call cacheprotected DatabaseMappingsourceMappingTable per class requires multiple query executions.protected org.eclipse.persistence.internal.sessions.AbstractRecordtranslationRowMappings and the descriptor use parameterized mechanisms that will be translated with the data from the row.
-
Constructor Summary
Constructors Constructor Description DatabaseQuery()PUBLIC: Initialize the state of the query
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddArgument(java.lang.String argumentName)PUBLIC: Add the argument named argumentName.voidaddArgument(java.lang.String argumentName, java.lang.Class type)PUBLIC: Add the argument named argumentName and its class type.voidaddArgument(java.lang.String argumentName, java.lang.Class type, boolean nullable)PUBLIC: Add the argument named argumentName and its class type.voidaddArgument(java.lang.String argumentName, java.lang.Class type, DatabaseQuery.ParameterType parameterType)INTERNAL: Add the argument named argumentName.voidaddArgument(java.lang.String argumentName, java.lang.Class type, DatabaseQuery.ParameterType argumentParameterType, boolean nullable)INTERNAL: Add the argument named argumentName.voidaddArgument(java.lang.String argumentName, java.lang.String typeAsString)PUBLIC: Add the argument named argumentName and its class type.voidaddArgumentByTypeName(java.lang.String argumentName, java.lang.String typeAsString)INTERNAL: Add an argument to the query, but do not resolve the class yet.voidaddArgumentValue(java.lang.Object argumentValue)PUBLIC: Add the argumentValue.voidaddArgumentValues(java.util.List theArgumentValues)PUBLIC: Add the argumentValues to the query.voidaddCall(Call call)PUBLIC: Used to define a store procedure or SQL query.voidaddStatement(org.eclipse.persistence.internal.expressions.SQLStatement statement)PUBLIC: Used to define a statement level query.voidbindAllParameters()PUBLIC: Bind all arguments to any SQL statement.java.util.List<org.eclipse.persistence.internal.helper.DatabaseField>buildArgumentFields()INTERNAL: Build the list of arguments fields from the argument names and types.protected voidbuildSelectionCriteria(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: In the case of EJBQL, an expression needs to be generated.voidcacheStatement()PUBLIC: Cache the prepared statements, this requires full parameter binding as well.voidcascadeAllParts()PUBLIC: Cascade the query and its properties on the queries object(s) and all objects related to the queries object(s).voidcascadeByMapping()PUBLIC: Cascade the query and its properties on the queries object(s) and all related objects where the mapping has been set to cascade the merge.voidcascadeOnlyDependentParts()INTERNAL: Used by unit of work, only cascades constraint dependencies.voidcascadePrivateParts()PUBLIC: Cascade the query and its properties on the queries object(s) and all privately owned objects related to the queries object(s).voidcheckDescriptor(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Ensure that the descriptor has been set.java.lang.ObjectcheckEarlyReturn(org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)INTERNAL: Check to see if this query already knows the return value without performing any further work.protected DatabaseQuerycheckForCustomQuery(org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)INTERNAL: Check to see if a custom query should be used for this query.voidcheckPrepare(org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)INTERNAL: Check to see if this query needs to be prepare and prepare it.voidcheckPrepare(org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, boolean force)INTERNAL: Check to see if this query needs to be prepare and prepare it.java.lang.Objectclone()INTERNAL: Clone the queryprotected voidclonedQueryExecutionComplete(DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL Used to give the subclasses opportunity to copy aspects of the cloned query to the original query.voidconvertClassNamesToClasses(java.lang.ClassLoader classLoader)INTERNAL: Convert all the class-name-based settings in this query to actual class-based settings This method is implemented by subclasses as necessary.voidcopyFromQuery(DatabaseQuery query)INTERNAL: Copy all setting from the query.voiddontBindAllParameters()PUBLIC: Do not Bind all arguments to any SQL statement.voiddontCacheStatement()PUBLIC: Don't cache the prepared statements, this requires full parameter binding as well.voiddontCascadeParts()PUBLIC: Do not cascade the query and its properties on the queries object(s) relationships.voiddontMaintainCache()PUBLIC: Set for the identity map (cache) to be ignored completely.java.lang.Objectexecute(org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)INTERNAL: Execute the query.abstract java.lang.ObjectexecuteDatabaseQuery()INTERNAL: Execute the queryjava.lang.ObjectexecuteInUnitOfWork(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)INTERNAL: Override query execution where Session is a UnitOfWork.java.lang.ObjectextractRemoteResult(org.eclipse.persistence.internal.sessions.remote.Transporter transporter)INTERNAL: Extract the correct query result from the transporter.org.eclipse.persistence.internal.databaseaccess.AccessorgetAccessor()INTERNAL: Return the accessor.java.util.Collection<org.eclipse.persistence.internal.databaseaccess.Accessor>getAccessors()INTERNAL: Return the accessors.java.util.List<DatabaseQuery.ParameterType>getArgumentParameterTypes()INTERNAL: Used to calculate parameter types in JPQLjava.util.List<java.lang.String>getArguments()INTERNAL: Return the arguments for use with the pre-defined query optionjava.util.List<java.lang.String>getArgumentTypeNames()INTERNAL: Return the argumentTypeNames for use with the pre-defined query option These are used pre-initialization to construct the argumentTypes list.java.util.List<java.lang.Class>getArgumentTypes()INTERNAL: Return the argumentTypes for use with the pre-defined query optionjava.util.List<java.lang.Object>getArgumentValues()INTERNAL: Return the argumentValues for use with argumented queries.java.util.Map<java.lang.Object,java.lang.Object>getBatchObjects()INTERNAL: Return temporary map of batched objects.org.eclipse.persistence.internal.databaseaccess.DatabaseCallgetCall()OBSOLETE: Return the call for this query.intgetCascadePolicy()INTERNAL: Return the cascade policy.CallgetDatasourceCall()ADVANCED: Return the call for this query.java.util.ListgetDatasourceCalls()ADVANCED: Return the calls for this query.protected QueryRedirectorgetDefaultRedirector()INTERNAL: Returns the specific default redirector for this query type.ClassDescriptorgetDescriptor()INTERNAL: Return the descriptor assigned with the reference classjava.util.List<ClassDescriptor>getDescriptors()INTERNAL: This is here only for JPA queries and currently only populated for JPA queries.java.lang.StringgetDomainClassNounName(java.lang.String sessionName)INTERNAL: TopLink_sessionName_domainClass.booleangetDoNotRedirect()This method is used in combination with redirected queries.java.lang.StringgetEJBQLString()PUBLIC: Return the EJBQL string of the query.org.eclipse.persistence.internal.sessions.AbstractSessiongetExecutionSession()INTERNAL: Return the execution session.java.lang.BooleangetFlushOnExecute()PUBLIC: If executed against a RepeatableWriteUnitOfWork if this attribute is true EclipseLink will write changes to the database before executing the query.java.lang.StringgetHintString()PUBLIC: Return the current database hint string of the query.java.lang.StringgetJPQLString()PUBLIC: Return the JPQL string of the query.java.lang.StringgetMonitorName()INTERNAL: Return the name to use for the query in performance monitoring.java.lang.StringgetName()PUBLIC: Return the name of the queryjava.util.List<org.eclipse.persistence.internal.helper.DatabaseField>getNullableArguments()INTERNAL: Return the list of arguments to check for null.java.lang.StringgetParameterDelimiter()INTERNAL: Return the String used to delimit an SQL parameter.chargetParameterDelimiterChar()INTERNAL: Return the char used to delimit an SQL parameter.PartitioningPolicygetPartitioningPolicy()PUBLIC: Return the query's partitioning policy.java.util.Map<java.lang.Object,java.lang.Object>getProperties()INTERNAL: Property support for use by mappings.java.lang.ObjectgetProperty(java.lang.Object property)INTERNAL: Property support used by mappings to store temporary stuff in the query.org.eclipse.persistence.internal.queries.DatabaseQueryMechanismgetQueryMechanism()INTERNAL: Return the mechanism assigned to the queryjava.lang.StringgetQueryNounName(java.lang.String sessionName)INTERNAL: TopLink_sessionName_domainClass_queryClass_queryName (if exist).intgetQueryTimeout()PUBLIC: Return the number of seconds the driver will wait for a Statement to execute to the given number of seconds.java.util.concurrent.TimeUnitgetQueryTimeoutUnit()PUBLIC: Return the unit of time the driver will wait for a Statement to execute.QueryRedirectorgetRedirector()PUBLIC: Return the query redirector.QueryRedirectorgetRedirectorForQuery()PUBLIC: Return the query redirector.java.lang.ClassgetReferenceClass()PUBLIC: Return the domain class associated with this query.java.lang.StringgetReferenceClassName()INTERNAL: return the name of the reference class.ExpressiongetSelectionCriteria()PUBLIC: Return the selection criteria of the query.java.lang.StringgetSensorName(java.lang.String operationName, java.lang.String sessionName)INTERNAL: TopLink_sessionName_domainClass_queryClass_queryName (if exist)_operationName (if exist).org.eclipse.persistence.internal.sessions.AbstractSessiongetSession()INTERNAL: Return the current session.java.lang.StringgetSessionName()PUBLIC: Return the name of the session that the query should be executed under.java.lang.BooleangetShouldBindAllParameters()INTERNAL: Returns the internal tri-state value of shouldBindParameters used far cascading these settingsDatabaseMappinggetSourceMapping()INTERNAL:org.eclipse.persistence.internal.expressions.SQLStatementgetSQLStatement()PUBLIC: Return the SQL statement of the query.java.lang.StringgetSQLString()ADVANCED: Return the SQL string of the query.java.util.ListgetSQLStrings()ADVANCED: Return the SQL strings of the query.java.lang.StringgetTranslatedSQLString(Session session, Record translationRow)ADVANCED: This can be used to access a queries translated SQL if they have been prepared, (i.e. query.prepareCall()).java.util.ListgetTranslatedSQLStrings(Session session, Record translationRow)ADVANCED: This can be used to access a queries translated SQL if they have been prepared, (i.e. query.prepareCall()).org.eclipse.persistence.internal.sessions.AbstractRecordgetTranslationRow()INTERNAL: Return the row for translationbooleanhasAccessor()INTERNAL: returns true if the accessor has already been set.booleanhasArguments()INTERNAL: Return if any arguments exist in the query.booleanhasNullableArguments()INTERNAL: Return if the query has any nullable arguments.booleanhasProperties()INTERNAL: Return if any properties exist in the query.booleanhasQueryMechanism()INTERNAL: Check if the mechanism has been set yet, used for lazy init.booleanhasSessionName()PUBLIC: Return if a name of the session that the query should be executed under has been specified.voidignoreBindAllParameters()PUBLIC: Session's shouldBindAllParameters() defines whether to bind or not (default setting)voidignoreCacheStatement()PUBLIC: Session's shouldCacheAllStatements() defines whether to cache or not (default setting)booleanisCallQuery()PUBLIC: Return true if this query uses SQL, a stored procedure, or SDK call.booleanisCascadeOfAggregateDelete()INTERNAL: Returns true if this query has been created as the result of cascading a delete of an aggregate collection in a UnitOfWork CR 2811java.lang.BooleanisCustomQueryUsed()INTERNAL: PERF: Return if this query will use the descriptor custom query instead of executing itself.protected booleanisCustomSelectionQuery()INTERNAL: If the query mechanism is a call query mechanism and there are no arguments on the query then it must be a foreign reference custom selection query.booleanisDataModifyQuery()PUBLIC: Return if this is a data modify query.booleanisDataReadQuery()PUBLIC: Return if this is a data read query.booleanisDefaultPropertiesQuery()INTERNAL: Return true if the query uses default properties.booleanisDeleteAllQuery()PUBLIC: Return if this is a delete all query.booleanisDeleteObjectQuery()PUBLIC: Return if this is a delete object query.booleanisDirectReadQuery()PUBLIC: Return if this is a direct read query.booleanisExecutionClone()INTERNAL: PERF: Return if the query is an execution clone.booleanisExpressionQuery()PUBLIC: Return true if this query uses an expression query mechanismbooleanisInsertObjectQuery()PUBLIC: Return true if this is an insert object query.booleanisJPQLCallQuery()PUBLIC: Return true if this query uses an JPQL query mechanism .booleanisModifyAllQuery()PUBLIC: Return true if this is a modify all query.booleanisModifyQuery()PUBLIC: Return true if this is a modify query.booleanisNativeConnectionRequired()ADVANCED: Return if the descriptor requires usage of a native (unwrapped) JDBC connection.booleanisObjectBuildingQuery()PUBLIC: Return if this is an object building query.booleanisObjectLevelModifyQuery()PUBLIC: Return true if this is an object level modify query.booleanisObjectLevelReadQuery()PUBLIC: Return true if this is an object level read query.booleanisPrepared()INTERNAL: Queries are prepared when they are executed and then do not need to be prepared on subsequent executions.booleanisReadAllQuery()PUBLIC: Return true if this is a read all query.booleanisReadObjectQuery()PUBLIC: Return true if this is a read object query.booleanisReadQuery()PUBLIC: Return true if this is a read query.booleanisReportQuery()PUBLIC: Return true if this is a report query.booleanisResultSetMappingQuery()PUBLIC: Return true if this is a result set mapping query.booleanisSQLCallQuery()PUBLIC: Return true if this query uses an SQL query mechanism .booleanisUpdateAllQuery()PUBLIC: Return true if this is an update all query.booleanisUpdateObjectQuery()PUBLIC: Return true if this is an update object query.booleanisUserDefined()INTERNAL: Return true if the query is a custom user defined query.booleanisUserDefinedSQLCall()INTERNAL: Return true if the query is a custom user defined SQL call query.booleanisValueReadQuery()PUBLIC: Return if this is a value read query.booleanisWriteObjectQuery()PUBLIC: Return true if this is a write object query.voidmaintainCache()PUBLIC: Set for the identity map (cache) to be maintained.protected voidprepare()INTERNAL: This is different from 'prepareForExecution' in that this is called on the original query, and the other is called on the copy of the query.voidprepareCall(Session session, Record translationRow)ADVANCED: Pre-generate the call/SQL for the query.protected voidprepareCustomQuery(DatabaseQuery customQuery)INTERNAL: Set the properties needed to be cascaded into the custom query.voidprepareForExecution()INTERNAL: Prepare the receiver for execution in a session.protected voidprepareForRemoteExecution()voidprepareFromQuery(DatabaseQuery query)INTERNAL: Prepare the query from the prepared query.voidprepareInternal(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Call the prepare on the query.java.lang.ObjectredirectQuery(QueryRedirector redirector, DatabaseQuery queryToRedirect, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)INTERNAL: Use a EclipseLink redirector to redirect this query to a method.protected java.lang.ObjectremoteExecute()java.lang.ObjectremoteExecute(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL:voidremoveProperty(java.lang.Object property)INTERNAL: Property support used by mappings.java.util.MapreplaceValueHoldersIn(java.lang.Object object, org.eclipse.persistence.internal.sessions.remote.RemoteSessionController controller)INTERNAL: replace the value holders in the specified result object(s)voidresetMonitorName()INTERNAL: Return the name to use for the query in performance monitoring.voidretrieveBypassCache()ADVANCED: JPA flag used to control the behavior of the shared cache.org.eclipse.persistence.internal.sessions.AbstractRecordrowFromArguments(java.util.List argumentValues, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Translate argumentValues into a database row.voidsetAccessor(org.eclipse.persistence.internal.databaseaccess.Accessor accessor)INTERNAL: Set the accessor, the query must always use the same accessor for database access.voidsetAccessors(java.util.Collection<org.eclipse.persistence.internal.databaseaccess.Accessor> accessors)INTERNAL: Set the list of connection accessors to execute the query on.voidsetAllowNativeSQLQuery(java.lang.Boolean allowNativeSQLQuery)INTERNAL: Set to true if this individual query should be marked to bypass a persistence unit level disallow SQL queries flag.voidsetArguments(java.util.List<java.lang.String> arguments)INTERNAL: Set the arguments for use with the pre-defined query option.voidsetArgumentTypeNames(java.util.List<java.lang.String> argumentTypeNames)INTERNAL: Set the argumentTypes for use with the pre-defined query optionvoidsetArgumentTypes(java.util.List<java.lang.Class> argumentTypes)INTERNAL: Set the argumentTypes for use with the pre-defined query optionvoidsetArgumentValues(java.util.List<java.lang.Object> theArgumentValues)INTERNAL: Set the argumentValues for use with argumented queries.voidsetBatchObjects(java.util.Map<java.lang.Object,java.lang.Object> batchObjects)INTERNAL: Set temporary map of batched objects.voidsetCall(Call call)PUBLIC: Used to define a store procedure or SQL query.voidsetCascadePolicy(int policyConstant)INTERNAL: Set the cascade policy.voidsetDatasourceCall(Call call)PUBLIC: Used to define a store procedure or SQL query.voidsetDescriptor(ClassDescriptor descriptor)INTERNAL: Set the descriptor for the query.voidsetDoNotRedirect(boolean doNotRedirect)This method is used in combination with redirected queries.voidsetEJBQLString(java.lang.String ejbqlString)PUBLIC: Set the EJBQL string of the query.protected voidsetExecutionSession(org.eclipse.persistence.internal.sessions.AbstractSession executionSession)INTERNAL: Set the execution session.voidsetFlushOnExecute(java.lang.Boolean flushMode)PUBLIC: If executed against a RepeatableWriteUnitOfWork if this attribute is true EclipseLink will write changes to the database before executing the query.voidsetHintString(java.lang.String newHintString)Used to set a database hint string on the query.protected voidsetIsCustomQueryUsed(boolean isCustomQueryUsed)INTERNAL: PERF: Set if this query will use the descriptor custom query instead of executing itself.voidsetIsExecutionClone(boolean isExecutionClone)INTERNAL: PERF: Set if the query is an execution clone.voidsetIsNativeConnectionRequired(boolean isNativeConnectionRequired)ADVANCED: Set if the descriptor requires usage of a native (unwrapped) JDBC connection.voidsetIsPrepared(boolean isPrepared)INTERNAL: If changes are made to the query that affect the derived SQL or Call parameters the query needs to be prepared again.voidsetIsUserDefined(boolean isUserDefined)INTERNAL: Set if the query is a custom user defined query.voidsetIsUserDefinedSQLCall(boolean isUserDefinedSQLCall)INTERNAL: Set if the query is a custom user defined sql call query.voidsetJPQLString(java.lang.String jpqlString)PUBLIC: Set the JPQL string of the query.voidsetName(java.lang.String queryName)PUBLIC: Set the query's name.voidsetNullableArguments(java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> nullableArguments)INTERNAL: Set the list of arguments to check for null.voidsetParameterDelimiter(java.lang.String aParameterDelimiter)INTERNAL: Set the String char used to delimit an SQL parameter.voidsetPartitioningPolicy(PartitioningPolicy partitioningPolicy)PUBLIC: Set the query's partitioning policy.voidsetProperties(java.util.Map<java.lang.Object,java.lang.Object> properties)INTERNAL: Property support used by mappings.voidsetProperty(java.lang.Object property, java.lang.Object value)INTERNAL: Property support used by mappings to store temporary stuff.protected voidsetQueryMechanism(org.eclipse.persistence.internal.queries.DatabaseQueryMechanism queryMechanism)Set the query mechanism for the query.voidsetQueryTimeout(int queryTimeout)PUBLIC: Set the number of seconds the driver will wait for a Statement to execute to the given number of seconds.voidsetQueryTimeoutUnit(java.util.concurrent.TimeUnit queryTimeoutUnit)voidsetRedirector(QueryRedirector redirector)PUBLIC: Set the query redirector.voidsetSelectionCriteria(Expression expression)PUBLIC: To any user of this object.voidsetSession(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Set the session for the queryvoidsetSessionName(java.lang.String sessionName)PUBLIC: Set the name of the session that the query should be executed under.voidsetShouldBindAllParameters(boolean shouldBindAllParameters)PUBLIC: Bind all arguments to any SQL statement.voidsetShouldBindAllParameters(java.lang.Boolean bindAllParams)INTERNAL: Sets the internal tri-state value of shouldBindAllParams Used to cascade this value to other queriesvoidsetShouldCacheStatement(boolean shouldCacheStatement)PUBLIC: Cache the prepared statements, this requires full parameter binding as well.voidsetShouldMaintainCache(boolean shouldMaintainCache)PUBLIC: Set if the identity map (cache) should be used or not.voidsetShouldPrepare(boolean shouldPrepare)PUBLIC: Set if the query should be prepared.voidsetShouldRetrieveBypassCache(boolean shouldRetrieveBypassCache)ADVANCED: JPA flag used to control the behavior of the shared cache.voidsetShouldReturnGeneratedKeys(boolean shouldReturnGeneratedKeys)ADVANCED: JPA flag used to control the behavior of IDENTITY generation.voidsetShouldStoreBypassCache(boolean shouldStoreBypassCache)ADVANCED: JPA flag used to control the behavior of the shared cache.voidsetShouldUseWrapperPolicy(boolean shouldUseWrapperPolicy)ADVANCED: The wrapper policy can be enable on a query.voidsetShouldValidateUpdateCallCacheUse(boolean shouldCheckUpdateCallCacheUse)INTERNAL: Set if additional validation should be performed before the query uses the update call cache.voidsetSourceMapping(DatabaseMapping sourceMapping)INTERNAL:voidsetSQLStatement(org.eclipse.persistence.internal.expressions.SQLStatement sqlStatement)PUBLIC: To any user of this object.voidsetSQLString(java.lang.String sqlString)PUBLIC: To any user of this object.voidsetTranslationRow(org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)INTERNAL: Set the row for translationbooleanshouldAllowNativeSQLQuery(boolean projectAllowsNativeQueries)INTERNAL: Return true if this individual query should allow native a SQL call to be issued.booleanshouldBindAllParameters()PUBLIC: Bind all arguments to any SQL statement.booleanshouldCacheStatement()PUBLIC: Cache the prepared statements, this requires full parameter binding as well.booleanshouldCascadeAllParts()PUBLIC: Flag used to determine if all parts should be cascadedbooleanshouldCascadeByMapping()PUBLIC: Mappings should be checked to determined if the current operation should be cascaded to the objects referenced.booleanshouldCascadeOnlyDependentParts()INTERNAL: Flag used for unit of works cascade policy.booleanshouldCascadeParts()PUBLIC: Flag used to determine if any parts should be cascadedbooleanshouldCascadePrivateParts()PUBLIC: Flag used to determine if any private parts should be cascadedbooleanshouldCloneCall()INTERNAL: Flag used to determine if the call needs to be cloned.booleanshouldIgnoreBindAllParameters()PUBLIC: Local shouldBindAllParameters() should be ignored, Session's shouldBindAllParameters() should be used.booleanshouldIgnoreCacheStatement()PUBLIC: Local shouldCacheStatement() should be ignored, Session's shouldCacheAllStatements() should be used.booleanshouldMaintainCache()PUBLIC: Return if the identity map (cache) should be used or not.booleanshouldPrepare()PUBLIC: Return if the query should be prepared.booleanshouldPrepare(org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Check if the query should be prepared, or dynamic, depending on the arguments.booleanshouldRetrieveBypassCache()ADVANCED: JPA flag used to control the behavior of the shared cache.booleanshouldReturnGeneratedKeys()ADVANCED: JPA flag used to control the behavior of IDENTITY generation.booleanshouldStoreBypassCache()ADVANCED: JPA flag used to control the behavior of the shared cache.booleanshouldUseWrapperPolicy()ADVANCED: The wrapper policy can be enabled on a query.booleanshouldValidateUpdateCallCacheUse()ADVANCED: Return true if additional validation should be performed before the query uses the update call cache, false otherwise.voidstoreBypassCache()ADVANCED: JPA flag used to control the behavior of the shared cache.java.lang.StringtoString()
-
-
-
Field Detail
-
BATCH_FETCH_PROPERTY
public static final java.lang.String BATCH_FETCH_PROPERTY
INTERNAL: Property used for batch fetching in non object queries.- See Also:
- Constant Field Values
-
name
protected java.lang.String name
Queries can be given a name and registered with a descriptor to allow common queries to be reused.
-
arguments
protected java.util.List<java.lang.String> arguments
Arguments can be given and specified to predefined queries to allow reuse.
-
argumentFields
protected java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> argumentFields
PERF: Argument fields are cached in prepare to avoid rebuilding on each execution.
-
argumentValues
protected java.util.List<java.lang.Object> argumentValues
Arguments values can be given and specified to predefined queries to allow reuse.
-
argumentTypes
protected java.util.List<java.lang.Class> argumentTypes
Needed to differentiate queries with the same name.
-
argumentTypeNames
protected java.util.List<java.lang.String> argumentTypeNames
Used to build a list of argumentTypes by name pre-initialization
-
argumentParameterTypes
protected java.util.List<DatabaseQuery.ParameterType> argumentParameterTypes
-
descriptor
protected transient ClassDescriptor descriptor
The descriptor cached on the prepare for object level queries.
-
descriptors
protected java.util.List<ClassDescriptor> descriptors
The list of descriptors this query deals with. Set via JPA processing for table per tenant queries
-
queryMechanism
protected org.eclipse.persistence.internal.queries.DatabaseQueryMechanism queryMechanism
The query mechanism determines the mechanism on how the database will be accessed.
-
redirector
protected QueryRedirector redirector
A redirector allows for a queries execution to be the execution of a piece of code.
-
doNotRedirect
protected boolean doNotRedirect
Can be set to true in the case there is a redirector or a default redirector but the user does not want the query redirected.
-
shouldMaintainCache
protected boolean shouldMaintainCache
Flag used for a query to bypass the identitymap and unit of work.
-
shouldRetrieveBypassCache
protected boolean shouldRetrieveBypassCache
JPA flags to control the shared cache
-
shouldStoreBypassCache
protected boolean shouldStoreBypassCache
-
allowNativeSQLQuery
protected java.lang.Boolean allowNativeSQLQuery
Property used to override a persistence unit level that disallows native SQL queries.
-
properties
protected java.util.Map<java.lang.Object,java.lang.Object> properties
Internally used by the mappings as a temporary store.
-
session
protected transient org.eclipse.persistence.internal.sessions.AbstractSession session
Only used after the query is cloned for execution to store the session under which the query was executed.
-
executionSession
protected transient org.eclipse.persistence.internal.sessions.AbstractSession executionSession
Only used after the query is cloned for execution to store the execution session under which the query was executed.
-
accessors
protected transient java.util.Collection<org.eclipse.persistence.internal.databaseaccess.Accessor> accessors
Connection to use for database access, required for server session connection pooling. There can be multiple connections with partitioning and replication.
-
translationRow
protected org.eclipse.persistence.internal.sessions.AbstractRecord translationRow
Mappings and the descriptor use parameterized mechanisms that will be translated with the data from the row.
-
isUserDefined
protected boolean isUserDefined
Internal flag used to bypass user define queries when executing one for custom sql/query support.
-
isUserDefinedSQLCall
protected boolean isUserDefinedSQLCall
Internal flag used to bypass user define queries when executing one for custom sql/query support.
-
cascadePolicy
protected int cascadePolicy
Policy that determines how the query will cascade to its object's parts.
-
sessionName
protected java.lang.String sessionName
Used to override the default session in the session broker.
-
isPrepared
protected boolean isPrepared
Queries prepare common stated in themselves.
-
shouldCloneCall
protected boolean shouldCloneCall
Used to indicate whether or not the call needs to be cloned.
-
shouldPrepare
protected boolean shouldPrepare
Allow for the prepare of queries to be turned off, this allow for dynamic non-pre SQL generated queries.
-
nullableArguments
protected java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> nullableArguments
List of arguments to check for null. If any are null, the query needs to be re-prepared.
-
shouldBindAllParameters
protected java.lang.Boolean shouldBindAllParameters
Bind all arguments to the SQL statement.
-
shouldCacheStatement
protected java.lang.Boolean shouldCacheStatement
Cache the prepared statement, this requires full parameter binding as well.
-
shouldUseWrapperPolicy
protected boolean shouldUseWrapperPolicy
Use the WrapperPolicy for the objects returned by the query
-
sourceMapping
protected DatabaseMapping sourceMapping
Table per class requires multiple query executions. Internally we prepare those queries and cache them against the source mapping's selection query. When queries are executed they are cloned so we need a mechanism to keep a reference back to the actual selection query so that we can successfully look up and chain query executions within a table per class inheritance hierarchy.
-
queryTimeout
protected int queryTimeout
queryTimeout has three possible settings: DefaultTimeout, NoTimeout, and 1..N This applies to both DatabaseQuery.queryTimeout and DescriptorQueryManager.queryTimeout DatabaseQuery.queryTimeout: - DefaultTimeout: get queryTimeout from DescriptorQueryManager - NoTimeout, 1..N: overrides queryTimeout in DescriptorQueryManager DescriptorQueryManager.queryTimeout: - DefaultTimeout: get queryTimeout from parent DescriptorQueryManager. If there is no parent, default to NoTimeout - NoTimeout, 1..N: overrides parent queryTimeout
-
queryTimeoutUnit
protected java.util.concurrent.TimeUnit queryTimeoutUnit
-
shouldReturnGeneratedKeys
protected boolean shouldReturnGeneratedKeys
-
NoCascading
public static final int NoCascading
- See Also:
- Constant Field Values
-
CascadePrivateParts
public static final int CascadePrivateParts
- See Also:
- Constant Field Values
-
CascadeAllParts
public static final int CascadeAllParts
- See Also:
- Constant Field Values
-
CascadeDependentParts
public static final int CascadeDependentParts
- See Also:
- Constant Field Values
-
CascadeAggregateDelete
public static final int CascadeAggregateDelete
- See Also:
- Constant Field Values
-
CascadeByMapping
public static final int CascadeByMapping
- See Also:
- Constant Field Values
-
hintString
protected java.lang.String hintString
Used for adding hints to the query string in oracle
-
flushOnExecute
protected java.lang.Boolean flushOnExecute
-
isExecutionClone
protected boolean isExecutionClone
PERF: Determines if the query has already been cloned for execution, to avoid duplicate cloning.
-
isCustomQueryUsed
protected volatile java.lang.Boolean isCustomQueryUsed
PERF: Store if this query will use the descriptor custom query.
-
isNativeConnectionRequired
protected boolean isNativeConnectionRequired
Allow connection unwrapping to be configured.
-
monitorName
protected transient java.lang.String monitorName
Return the name to use for the query in performance monitoring.
-
shouldValidateUpdateCallCacheUse
protected boolean shouldValidateUpdateCallCacheUse
Allow additional validation to be performed before using the update call cache
-
partitioningPolicy
protected PartitioningPolicy partitioningPolicy
Allow queries to be targeted at specific connection pools.
-
parameterDelimiter
protected java.lang.String parameterDelimiter
Allow the reserved pound char used to delimit bind parameters to be overridden
-
-
Method Detail
-
getPartitioningPolicy
public PartitioningPolicy getPartitioningPolicy()
PUBLIC: Return the query's partitioning policy.
-
setPartitioningPolicy
public void setPartitioningPolicy(PartitioningPolicy partitioningPolicy)
PUBLIC: Set the query's partitioning policy. A PartitioningPolicy is used to partition, load-balance or replicate data across multiple difference databases or across a database cluster such as Oracle RAC. Partitioning can provide improved scalability by allowing multiple database machines to service requests. Setting a policy on a query will override the descriptor and session defaults.
-
getMonitorName
public java.lang.String getMonitorName()
INTERNAL: Return the name to use for the query in performance monitoring.
-
resetMonitorName
public void resetMonitorName()
INTERNAL: Return the name to use for the query in performance monitoring.
-
addArgument
public void addArgument(java.lang.String argumentName)
PUBLIC: Add the argument named argumentName. This will cause the translation of references of argumentName in the receiver's expression, with the value of the argument as supplied to the query in order from executeQuery()
-
addArgument
public void addArgument(java.lang.String argumentName, java.lang.Class type)PUBLIC: Add the argument named argumentName and its class type. This will cause the translation of references of argumentName in the receiver's expression, with the value of the argument as supplied to the query in order from executeQuery(). Specifying the class type is important if identically named queries are used but with different argument lists.
-
addArgument
public void addArgument(java.lang.String argumentName, java.lang.Class type, DatabaseQuery.ParameterType parameterType)INTERNAL: Add the argument named argumentName. This method was added to maintain information about whether parameters are positional or named for JPQL query introspeciton API
-
addArgument
public void addArgument(java.lang.String argumentName, java.lang.Class type, boolean nullable)PUBLIC: Add the argument named argumentName and its class type. This will cause the translation of references of argumentName in the receiver's expression, with the value of the argument as supplied to the query in order from executeQuery(). Specifying the class type is important if identically named queries are used but with different argument lists. If the argument can be null, and null must be treated differently in the generated SQL, then nullable should be set to true.
-
addArgument
public void addArgument(java.lang.String argumentName, java.lang.Class type, DatabaseQuery.ParameterType argumentParameterType, boolean nullable)INTERNAL: Add the argument named argumentName. This method was added to maintain information about whether parameters are positional or named for JPQL query introspeciton API
-
addArgument
public void addArgument(java.lang.String argumentName, java.lang.String typeAsString)PUBLIC: Add the argument named argumentName and its class type. This will cause the translation of references of argumentName in the receiver's expression, with the value of the argument as supplied to the query in order from executeQuery(). Specifying the class type is important if identically named queries are used but with different argument lists.
-
addArgumentByTypeName
public void addArgumentByTypeName(java.lang.String argumentName, java.lang.String typeAsString)INTERNAL: Add an argument to the query, but do not resolve the class yet. This is useful for building a query without putting the domain classes on the classpath for the Mapping Workbench.
-
addArgumentValue
public void addArgumentValue(java.lang.Object argumentValue)
PUBLIC: Add the argumentValue. Argument values must be added in the same order the arguments are defined.
-
addArgumentValues
public void addArgumentValues(java.util.List theArgumentValues)
PUBLIC: Add the argumentValues to the query. Argument values must be added in the same order the arguments are defined.
-
addCall
public void addCall(Call call)
PUBLIC: Used to define a store procedure or SQL query. This may be used for multiple SQL executions to be mapped to a single query. This cannot be used for cursored selects, delete alls or does exists.
-
addStatement
public void addStatement(org.eclipse.persistence.internal.expressions.SQLStatement statement)
PUBLIC: Used to define a statement level query. This may be used for multiple SQL executions to be mapped to a single query. This cannot be used for cursored selects, delete all(s) or does exists.
-
bindAllParameters
public void bindAllParameters()
PUBLIC: Bind all arguments to any SQL statement.
-
buildSelectionCriteria
protected void buildSelectionCriteria(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: In the case of EJBQL, an expression needs to be generated. Build the required expression.
-
cacheStatement
public void cacheStatement()
PUBLIC: Cache the prepared statements, this requires full parameter binding as well.
-
cascadeAllParts
public void cascadeAllParts()
PUBLIC: Cascade the query and its properties on the queries object(s) and all objects related to the queries object(s). This includes private and independent relationships, but not read-only relationships. This will still stop on uninstantiated indirection objects except for deletion. Great caution should be used in using the property as the query may effect a large number of objects. This policy is used by the unit of work to ensure persistence by reachability.
-
cascadeByMapping
public void cascadeByMapping()
PUBLIC: Cascade the query and its properties on the queries object(s) and all related objects where the mapping has been set to cascade the merge.
-
cascadeOnlyDependentParts
public void cascadeOnlyDependentParts()
INTERNAL: Used by unit of work, only cascades constraint dependencies.
-
cascadePrivateParts
public void cascadePrivateParts()
PUBLIC: Cascade the query and its properties on the queries object(s) and all privately owned objects related to the queries object(s). This is the default for write and delete queries. This policy should normally be used for refreshing, otherwise you could refresh half of any object.
-
checkDescriptor
public void checkDescriptor(org.eclipse.persistence.internal.sessions.AbstractSession session) throws QueryExceptionINTERNAL: Ensure that the descriptor has been set.- Throws:
QueryException
-
checkEarlyReturn
public java.lang.Object checkEarlyReturn(org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)INTERNAL: Check to see if this query already knows the return value without performing any further work.
-
checkForCustomQuery
protected DatabaseQuery checkForCustomQuery(org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)
INTERNAL: Check to see if a custom query should be used for this query. This is done before the query is copied and prepared/executed. null means there is none.
-
checkPrepare
public void checkPrepare(org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)INTERNAL: Check to see if this query needs to be prepare and prepare it. The prepare is done on the original query to ensure that the work is not repeated.
-
prepareInternal
public void prepareInternal(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Call the prepare on the query.
-
checkPrepare
public void checkPrepare(org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, boolean force)INTERNAL: Check to see if this query needs to be prepare and prepare it. The prepare is done on the original query to ensure that the work is not repeated.
-
clone
public java.lang.Object clone()
INTERNAL: Clone the query- Overrides:
clonein classjava.lang.Object
-
clonedQueryExecutionComplete
protected void clonedQueryExecutionComplete(DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL Used to give the subclasses opportunity to copy aspects of the cloned query to the original query.
-
convertClassNamesToClasses
public void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this query to actual class-based settings This method is implemented by subclasses as necessary.- Parameters:
classLoader-
-
dontBindAllParameters
public void dontBindAllParameters()
PUBLIC: Do not Bind all arguments to any SQL statement.
-
dontCacheStatement
public void dontCacheStatement()
PUBLIC: Don't cache the prepared statements, this requires full parameter binding as well.
-
dontCascadeParts
public void dontCascadeParts()
PUBLIC: Do not cascade the query and its properties on the queries object(s) relationships. This does not effect the queries private parts but only the object(s) direct row-level attributes. This is the default for read queries and can be used in writing if it is known that only row-level attributes changed, or to resolve circular foreign key dependencies.
-
dontMaintainCache
public void dontMaintainCache()
PUBLIC: Set for the identity map (cache) to be ignored completely. The cache check will be skipped and the result will not be put into the identity map. This can be used to retrieve the exact state of an object on the database. By default the identity map is always maintained.
-
executeDatabaseQuery
public abstract java.lang.Object executeDatabaseQuery() throws DatabaseException, OptimisticLockExceptionINTERNAL: Execute the query- Returns:
- - the result of executing the query.
- Throws:
DatabaseException- - an error has occurred on the database.OptimisticLockException- - an error has occurred using the optimistic lock feature.
-
executeInUnitOfWork
public java.lang.Object executeInUnitOfWork(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow) throws DatabaseException, OptimisticLockExceptionINTERNAL: Override query execution where Session is a UnitOfWork.If there are objects in the cache return the results of the cache lookup.
- Parameters:
unitOfWork- - the session in which the receiver will be executed.translationRow- - the arguments- Returns:
- An object, the result of executing the query.
- Throws:
DatabaseException- - an error has occurred on the database.OptimisticLockException- - an error has occurred using the optimistic lock feature.
-
execute
public java.lang.Object execute(org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow) throws DatabaseException, OptimisticLockExceptionINTERNAL: Execute the query. If there are objects in the cache return the results of the cache lookup.- Parameters:
session- - the session in which the receiver will be executed.- Returns:
- An object, the result of executing the query.
- Throws:
DatabaseException- - an error has occurred on the database.OptimisticLockException- - an error has occurred using the optimistic lock feature.
-
extractRemoteResult
public java.lang.Object extractRemoteResult(org.eclipse.persistence.internal.sessions.remote.Transporter transporter)
INTERNAL: Extract the correct query result from the transporter.
-
getAccessor
public org.eclipse.persistence.internal.databaseaccess.Accessor getAccessor()
INTERNAL: Return the accessor.
-
getAccessors
public java.util.Collection<org.eclipse.persistence.internal.databaseaccess.Accessor> getAccessors()
INTERNAL: Return the accessors.
-
getArguments
public java.util.List<java.lang.String> getArguments()
INTERNAL: Return the arguments for use with the pre-defined query option
-
getArgumentParameterTypes
public java.util.List<DatabaseQuery.ParameterType> getArgumentParameterTypes()
INTERNAL: Used to calculate parameter types in JPQL- Returns:
-
getArgumentTypes
public java.util.List<java.lang.Class> getArgumentTypes()
INTERNAL: Return the argumentTypes for use with the pre-defined query option
-
getArgumentTypeNames
public java.util.List<java.lang.String> getArgumentTypeNames()
INTERNAL: Return the argumentTypeNames for use with the pre-defined query option These are used pre-initialization to construct the argumentTypes list.
-
setArgumentTypes
public void setArgumentTypes(java.util.List<java.lang.Class> argumentTypes)
INTERNAL: Set the argumentTypes for use with the pre-defined query option
-
setArgumentTypeNames
public void setArgumentTypeNames(java.util.List<java.lang.String> argumentTypeNames)
INTERNAL: Set the argumentTypes for use with the pre-defined query option
-
setArguments
public void setArguments(java.util.List<java.lang.String> arguments)
INTERNAL: Set the arguments for use with the pre-defined query option. Maintain the argumentTypes as well.
-
getArgumentValues
public java.util.List<java.lang.Object> getArgumentValues()
INTERNAL: Return the argumentValues for use with argumented queries.
-
setArgumentValues
public void setArgumentValues(java.util.List<java.lang.Object> theArgumentValues)
INTERNAL: Set the argumentValues for use with argumented queries.
-
getCall
public org.eclipse.persistence.internal.databaseaccess.DatabaseCall getCall()
OBSOLETE: Return the call for this query. This call contains the SQL and argument list.- See Also:
getDatasourceCall()
-
getDatasourceCall
public Call getDatasourceCall()
ADVANCED: Return the call for this query. This call contains the SQL and argument list.- See Also:
prepareCall(Session, Record)
-
getDatasourceCalls
public java.util.List getDatasourceCalls()
ADVANCED: Return the calls for this query. This method can be called for queries with multiple calls This call contains the SQL and argument list.- See Also:
prepareCall(Session, Record)
-
getCascadePolicy
public int getCascadePolicy()
INTERNAL: Return the cascade policy.
-
getDescriptor
public ClassDescriptor getDescriptor()
INTERNAL: Return the descriptor assigned with the reference class
-
getDescriptors
public java.util.List<ClassDescriptor> getDescriptors()
INTERNAL: This is here only for JPA queries and currently only populated for JPA queries. JPAQuery is a jpa class and currently not part of the core.
-
getDomainClassNounName
public java.lang.String getDomainClassNounName(java.lang.String sessionName)
INTERNAL: TopLink_sessionName_domainClass. Cached in properties
-
getName
public java.lang.String getName()
PUBLIC: Return the name of the query
-
getParameterDelimiter
public java.lang.String getParameterDelimiter()
INTERNAL: Return the String used to delimit an SQL parameter.
-
getParameterDelimiterChar
public char getParameterDelimiterChar()
INTERNAL: Return the char used to delimit an SQL parameter.
-
getProperties
public java.util.Map<java.lang.Object,java.lang.Object> getProperties()
INTERNAL: Property support for use by mappings.
-
getProperty
public java.lang.Object getProperty(java.lang.Object property)
INTERNAL: Property support used by mappings to store temporary stuff in the query.
-
getQueryNounName
public java.lang.String getQueryNounName(java.lang.String sessionName)
INTERNAL: TopLink_sessionName_domainClass_queryClass_queryName (if exist). Cached in properties
-
getQueryMechanism
public org.eclipse.persistence.internal.queries.DatabaseQueryMechanism getQueryMechanism()
INTERNAL: Return the mechanism assigned to the query
-
hasQueryMechanism
public boolean hasQueryMechanism()
INTERNAL: Check if the mechanism has been set yet, used for lazy init.
-
getQueryTimeout
public int getQueryTimeout()
PUBLIC: Return the number of seconds the driver will wait for a Statement to execute to the given number of seconds.- See Also:
DescriptorQueryManager.getQueryTimeout()
-
getQueryTimeoutUnit
public java.util.concurrent.TimeUnit getQueryTimeoutUnit()
PUBLIC: Return the unit of time the driver will wait for a Statement to execute.
-
getDefaultRedirector
protected QueryRedirector getDefaultRedirector()
INTERNAL: Returns the specific default redirector for this query type. There are numerous default query redirectors. See ClassDescriptor for their types.
-
getRedirectorForQuery
public QueryRedirector getRedirectorForQuery()
PUBLIC: Return the query redirector. A redirector can be used in a query to replace its execution with the execution of code. This can be used for named or parameterized queries to allow dynamic configuration of the query base on the query arguments.- See Also:
QueryRedirector
-
getRedirector
public QueryRedirector getRedirector()
PUBLIC: Return the query redirector. A redirector can be used in a query to replace its execution with the execution of code. This can be used for named or parameterized queries to allow dynamic configuration of the query base on the query arguments.- See Also:
QueryRedirector
-
getReferenceClass
public java.lang.Class getReferenceClass()
PUBLIC: Return the domain class associated with this query. By default this is null, but should be overridden in subclasses.
-
getReferenceClassName
public java.lang.String getReferenceClassName()
INTERNAL: return the name of the reference class. Added for Mapping Workbench removal of classpath dependency. Overridden by subclasses.
-
getSelectionCriteria
public Expression getSelectionCriteria()
PUBLIC: Return the selection criteria of the query. This should only be used with expression queries, null will be returned for others.
-
getSensorName
public java.lang.String getSensorName(java.lang.String operationName, java.lang.String sessionName)INTERNAL: TopLink_sessionName_domainClass_queryClass_queryName (if exist)_operationName (if exist). Cached in properties
-
getSession
public org.eclipse.persistence.internal.sessions.AbstractSession getSession()
INTERNAL: Return the current session.
-
getExecutionSession
public org.eclipse.persistence.internal.sessions.AbstractSession getExecutionSession()
INTERNAL: Return the execution session. This is the session used to build objects returned by the query.
-
setExecutionSession
protected void setExecutionSession(org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
INTERNAL: Set the execution session. This is the session used to build objects returned by the query.
-
getSessionName
public java.lang.String getSessionName()
PUBLIC: Return the name of the session that the query should be executed under. This can be with the session broker to override the default session.
-
getSQLStatement
public org.eclipse.persistence.internal.expressions.SQLStatement getSQLStatement()
PUBLIC: Return the SQL statement of the query. This can only be used with statement queries.
-
getJPQLString
public java.lang.String getJPQLString()
PUBLIC: Return the JPQL string of the query.
-
getEJBQLString
public java.lang.String getEJBQLString()
PUBLIC: Return the EJBQL string of the query.
-
getHintString
public java.lang.String getHintString()
PUBLIC: Return the current database hint string of the query.
-
getSQLString
public java.lang.String getSQLString()
ADVANCED: Return the SQL string of the query. This can be used for SQL queries. This can also be used for normal queries if they have been prepared, (i.e. query.prepareCall()).- See Also:
prepareCall(Session, Record)
-
getSQLStrings
public java.util.List getSQLStrings()
ADVANCED: Return the SQL strings of the query. Used for queries with multiple calls This can be used for SQL queries. This can also be used for normal queries if they have been prepared, (i.e. query.prepareCall()).- See Also:
prepareCall(Session, Record)
-
getShouldBindAllParameters
public java.lang.Boolean getShouldBindAllParameters()
INTERNAL: Returns the internal tri-state value of shouldBindParameters used far cascading these settings
-
getSourceMapping
public DatabaseMapping getSourceMapping()
INTERNAL:
-
getTranslatedSQLString
public java.lang.String getTranslatedSQLString(Session session, Record translationRow)
ADVANCED: This can be used to access a queries translated SQL if they have been prepared, (i.e. query.prepareCall()). The Record argument is one of (Record, XMLRecord) that contains the query arguments.
-
getTranslatedSQLStrings
public java.util.List getTranslatedSQLStrings(Session session, Record translationRow)
ADVANCED: This can be used to access a queries translated SQL if they have been prepared, (i.e. query.prepareCall()). This method can be used for queries with multiple calls.- See Also:
prepareCall(Session, Record)
-
getTranslationRow
public org.eclipse.persistence.internal.sessions.AbstractRecord getTranslationRow()
INTERNAL: Return the row for translation
-
hasAccessor
public boolean hasAccessor()
INTERNAL: returns true if the accessor has already been set. The getAccessor() will attempt to lazily initialize it.
-
hasProperties
public boolean hasProperties()
INTERNAL: Return if any properties exist in the query.
-
hasArguments
public boolean hasArguments()
INTERNAL: Return if any arguments exist in the query.
-
hasSessionName
public boolean hasSessionName()
PUBLIC: Return if a name of the session that the query should be executed under has been specified. This can be with the session broker to override the default session.
-
ignoreBindAllParameters
public void ignoreBindAllParameters()
PUBLIC: Session's shouldBindAllParameters() defines whether to bind or not (default setting)
-
ignoreCacheStatement
public void ignoreCacheStatement()
PUBLIC: Session's shouldCacheAllStatements() defines whether to cache or not (default setting)
-
isCallQuery
public boolean isCallQuery()
PUBLIC: Return true if this query uses SQL, a stored procedure, or SDK call.
-
isCascadeOfAggregateDelete
public boolean isCascadeOfAggregateDelete()
INTERNAL: Returns true if this query has been created as the result of cascading a delete of an aggregate collection in a UnitOfWork CR 2811
-
isDataModifyQuery
public boolean isDataModifyQuery()
PUBLIC: Return if this is a data modify query.
-
isDataReadQuery
public boolean isDataReadQuery()
PUBLIC: Return if this is a data read query.
-
isValueReadQuery
public boolean isValueReadQuery()
PUBLIC: Return if this is a value read query.
-
isDirectReadQuery
public boolean isDirectReadQuery()
PUBLIC: Return if this is a direct read query.
-
isDeleteAllQuery
public boolean isDeleteAllQuery()
PUBLIC: Return if this is a delete all query.
-
isDeleteObjectQuery
public boolean isDeleteObjectQuery()
PUBLIC: Return if this is a delete object query.
-
isExpressionQuery
public boolean isExpressionQuery()
PUBLIC: Return true if this query uses an expression query mechanism
-
isModifyAllQuery
public boolean isModifyAllQuery()
PUBLIC: Return true if this is a modify all query.
-
isModifyQuery
public boolean isModifyQuery()
PUBLIC: Return true if this is a modify query.
-
isUpdateAllQuery
public boolean isUpdateAllQuery()
PUBLIC: Return true if this is an update all query.
-
isUpdateObjectQuery
public boolean isUpdateObjectQuery()
PUBLIC: Return true if this is an update object query.
-
getFlushOnExecute
public java.lang.Boolean getFlushOnExecute()
PUBLIC: If executed against a RepeatableWriteUnitOfWork if this attribute is true EclipseLink will write changes to the database before executing the query.
-
isInsertObjectQuery
public boolean isInsertObjectQuery()
PUBLIC: Return true if this is an insert object query.
-
isObjectLevelModifyQuery
public boolean isObjectLevelModifyQuery()
PUBLIC: Return true if this is an object level modify query.
-
isObjectLevelReadQuery
public boolean isObjectLevelReadQuery()
PUBLIC: Return true if this is an object level read query.
-
isObjectBuildingQuery
public boolean isObjectBuildingQuery()
PUBLIC: Return if this is an object building query.
-
isPrepared
public boolean isPrepared()
INTERNAL: Queries are prepared when they are executed and then do not need to be prepared on subsequent executions. This method returns true if this query has been prepared. Updating the settings on a query will 'un-prepare' the query.
-
isReadAllQuery
public boolean isReadAllQuery()
PUBLIC: Return true if this is a read all query.
-
isReadObjectQuery
public boolean isReadObjectQuery()
PUBLIC: Return true if this is a read object query.
-
isReadQuery
public boolean isReadQuery()
PUBLIC: Return true if this is a read query.
-
isReportQuery
public boolean isReportQuery()
PUBLIC: Return true if this is a report query.
-
isResultSetMappingQuery
public boolean isResultSetMappingQuery()
PUBLIC: Return true if this is a result set mapping query.
-
isSQLCallQuery
public boolean isSQLCallQuery()
PUBLIC: Return true if this query uses an SQL query mechanism .
-
isJPQLCallQuery
public boolean isJPQLCallQuery()
PUBLIC: Return true if this query uses an JPQL query mechanism .
-
isUserDefined
public boolean isUserDefined()
INTERNAL: Return true if the query is a custom user defined query.
-
isUserDefinedSQLCall
public boolean isUserDefinedSQLCall()
INTERNAL: Return true if the query is a custom user defined SQL call query.
-
isDefaultPropertiesQuery
public boolean isDefaultPropertiesQuery()
INTERNAL: Return true if the query uses default properties. This is used to determine if this query is cacheable. i.e. does not use any properties that may conflict with another query with the same EJBQL or selection criteria.
-
isWriteObjectQuery
public boolean isWriteObjectQuery()
PUBLIC: Return true if this is a write object query.
-
maintainCache
public void maintainCache()
PUBLIC: Set for the identity map (cache) to be maintained. This is the default.
-
prepare
protected void prepare() throws QueryExceptionINTERNAL: This is different from 'prepareForExecution' in that this is called on the original query, and the other is called on the copy of the query. This query is copied for concurrency so this prepare can only setup things that will apply to any future execution of this query. Resolve the queryTimeout using the DescriptorQueryManager if required.- Throws:
QueryException
-
copyFromQuery
public void copyFromQuery(DatabaseQuery query)
INTERNAL: Copy all setting from the query. This is used to morph queries from one type to the other. By default this calls prepareFromQuery, but additional properties may be required to be copied as prepareFromQuery only copies properties that affect the SQL.
-
prepareFromQuery
public void prepareFromQuery(DatabaseQuery query)
INTERNAL: Prepare the query from the prepared query. This allows a dynamic query to prepare itself directly from a prepared query instance. This is used in the JPQL parse cache to allow preparsed queries to be used to prepare dynamic queries. This only copies over properties that are configured through JPQL.
-
prepareCall
public void prepareCall(Session session, Record translationRow) throws QueryException
ADVANCED: Pre-generate the call/SQL for the query. This method takes a Session and an implementor of Record (DatebaseRow or XMLRecord). This can be used to access the SQL for a query without executing it. To access the call use, query.getCall(), or query.getSQLString() for the SQL. Note the SQL will have argument markers in it (i.e. "?"). To translate these use query.getTranslatedSQLString(session, translationRow).
-
prepareCustomQuery
protected void prepareCustomQuery(DatabaseQuery customQuery)
INTERNAL: Set the properties needed to be cascaded into the custom query.
-
prepareForExecution
public void prepareForExecution() throws QueryExceptionINTERNAL: Prepare the receiver for execution in a session. In particular, set the descriptor of the receiver to the ClassDescriptor for the appropriate class for the receiver's object.- Throws:
QueryException
-
prepareForRemoteExecution
protected void prepareForRemoteExecution()
-
redirectQuery
public java.lang.Object redirectQuery(QueryRedirector redirector, DatabaseQuery queryToRedirect, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)
INTERNAL: Use a EclipseLink redirector to redirect this query to a method. Added for bug 3241138
-
remoteExecute
protected java.lang.Object remoteExecute()
-
remoteExecute
public java.lang.Object remoteExecute(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
-
removeProperty
public void removeProperty(java.lang.Object property)
INTERNAL: Property support used by mappings.
-
replaceValueHoldersIn
public java.util.Map replaceValueHoldersIn(java.lang.Object object, org.eclipse.persistence.internal.sessions.remote.RemoteSessionController controller)INTERNAL: replace the value holders in the specified result object(s)
-
retrieveBypassCache
public void retrieveBypassCache()
ADVANCED: JPA flag used to control the behavior of the shared cache. This flag specifies the behavior when data is retrieved by the find methods and by the execution of queries. Calling this method will set a retrieve bypass to true.
-
buildArgumentFields
public java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> buildArgumentFields()
INTERNAL: Build the list of arguments fields from the argument names and types.
-
rowFromArguments
public org.eclipse.persistence.internal.sessions.AbstractRecord rowFromArguments(java.util.List argumentValues, org.eclipse.persistence.internal.sessions.AbstractSession session) throws QueryExceptionINTERNAL: Translate argumentValues into a database row.- Throws:
QueryException
-
setAccessors
public void setAccessors(java.util.Collection<org.eclipse.persistence.internal.databaseaccess.Accessor> accessors)
INTERNAL: Set the list of connection accessors to execute the query on.
-
setAccessor
public void setAccessor(org.eclipse.persistence.internal.databaseaccess.Accessor accessor)
INTERNAL: Set the accessor, the query must always use the same accessor for database access. This is required to support connection pooling.
-
setDatasourceCall
public void setDatasourceCall(Call call)
PUBLIC: Used to define a store procedure or SQL query.
-
setCall
public void setCall(Call call)
PUBLIC: Used to define a store procedure or SQL query.
-
setCascadePolicy
public void setCascadePolicy(int policyConstant)
INTERNAL: Set the cascade policy.
-
setDescriptor
public void setDescriptor(ClassDescriptor descriptor)
INTERNAL: Set the descriptor for the query.
-
setJPQLString
public void setJPQLString(java.lang.String jpqlString)
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.
-
setEJBQLString
public void setEJBQLString(java.lang.String ejbqlString)
PUBLIC: Set the EJBQL string of the query. If arguments are required in the string they will be preceded by "?" then the argument number.
-
setFlushOnExecute
public void setFlushOnExecute(java.lang.Boolean flushMode)
PUBLIC: If executed against a RepeatableWriteUnitOfWork if this attribute is true EclipseLink will write changes to the database before executing the query.
-
setHintString
public void setHintString(java.lang.String newHintString)
Used to set a database hint string on the query. This should be the full hint string including the comment delimiters. The hint string will be generated into the SQL string after the SELECT/INSERT/UPDATE/DELETE instruction.Example:
readAllQuery.setHintString("/*+ index(scott.emp ix_emp) * /");would result in SQL like:select /*+ index(scott.emp ix_emp) * / from scott.emp emp_alias
This method will cause a query to re-prepare if it has already been executed.
- Parameters:
newHintString- the hint string to be added into the SQL call.
-
setIsPrepared
public void setIsPrepared(boolean isPrepared)
INTERNAL: If changes are made to the query that affect the derived SQL or Call parameters the query needs to be prepared again.Automatically called internally.
-
isExecutionClone
public boolean isExecutionClone()
INTERNAL: PERF: Return if the query is an execution clone. This allow the clone during execution to be avoided in the cases when the query has already been clone elsewhere.
-
setIsExecutionClone
public void setIsExecutionClone(boolean isExecutionClone)
INTERNAL: PERF: Set if the query is an execution clone. This allow the clone during execution to be avoided in the cases when the query has already been clone elsewhere.
-
isCustomQueryUsed
public java.lang.Boolean isCustomQueryUsed()
INTERNAL: PERF: Return if this query will use the descriptor custom query instead of executing itself.
-
isCustomSelectionQuery
protected boolean isCustomSelectionQuery()
INTERNAL: If the query mechanism is a call query mechanism and there are no arguments on the query then it must be a foreign reference custom selection query.
-
setIsCustomQueryUsed
protected void setIsCustomQueryUsed(boolean isCustomQueryUsed)
INTERNAL: PERF: Set if this query will use the descriptor custom query instead of executing itself.- Parameters:
isCustomQueryUsed- Custom query flag asboolean.
-
setIsUserDefined
public void setIsUserDefined(boolean isUserDefined)
INTERNAL: Set if the query is a custom user defined query.
-
setIsUserDefinedSQLCall
public void setIsUserDefinedSQLCall(boolean isUserDefinedSQLCall)
INTERNAL: Set if the query is a custom user defined sql call query.
-
setName
public void setName(java.lang.String queryName)
PUBLIC: Set the query's name. Queries can be named and added to a descriptor or the session and then referenced by name.
-
setParameterDelimiter
public void setParameterDelimiter(java.lang.String aParameterDelimiter)
INTERNAL: Set the String char used to delimit an SQL parameter.
-
setProperties
public void setProperties(java.util.Map<java.lang.Object,java.lang.Object> properties)
INTERNAL: Property support used by mappings.
-
setProperty
public void setProperty(java.lang.Object property, java.lang.Object value)INTERNAL: Property support used by mappings to store temporary stuff.
-
setQueryMechanism
protected void setQueryMechanism(org.eclipse.persistence.internal.queries.DatabaseQueryMechanism queryMechanism)
Set the query mechanism for the query.
-
setQueryTimeout
public void setQueryTimeout(int queryTimeout)
PUBLIC: Set the number of seconds the driver will wait for a Statement to execute to the given number of seconds. If the limit is exceeded, a DatabaseException is thrown. queryTimeout - the new query timeout limit in seconds; DefaultTimeout is the default, which redirects to DescriptorQueryManager's queryTimeout.
-
setQueryTimeoutUnit
public void setQueryTimeoutUnit(java.util.concurrent.TimeUnit queryTimeoutUnit)
-
setRedirector
public void setRedirector(QueryRedirector redirector)
PUBLIC: Set the query redirector. A redirector can be used in a query to replace its execution with the execution of code. This can be used for named or parameterized queries to allow dynamic configuration of the query base on the query arguments.- See Also:
QueryRedirector
-
setSelectionCriteria
public void setSelectionCriteria(Expression expression)
PUBLIC: To any user of this object. Set the selection criteria of the query. This method be used when dealing with expressions.
-
setSession
public void setSession(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Set the session for the query
-
setSessionName
public void setSessionName(java.lang.String sessionName)
PUBLIC: Set the name of the session that the query should be executed under. This can be with the session broker to override the default session.
-
setShouldBindAllParameters
public void setShouldBindAllParameters(boolean shouldBindAllParameters)
PUBLIC: Bind all arguments to any SQL statement.
-
setShouldBindAllParameters
public void setShouldBindAllParameters(java.lang.Boolean bindAllParams)
INTERNAL: Sets the internal tri-state value of shouldBindAllParams Used to cascade this value to other queries
-
setShouldCacheStatement
public void setShouldCacheStatement(boolean shouldCacheStatement)
PUBLIC: Cache the prepared statements, this requires full parameter binding as well.
-
setShouldMaintainCache
public void setShouldMaintainCache(boolean shouldMaintainCache)
PUBLIC: Set if the identity map (cache) should be used or not. If not the cache check will be skipped and the result will not be put into the identity map. By default the identity map is always maintained.
-
setShouldPrepare
public void setShouldPrepare(boolean shouldPrepare)
PUBLIC: Set if the query should be prepared. EclipseLink automatically prepares queries to generate their SQL only once, one each execution of the query the SQL does not need to be generated again only the arguments need to be translated. This option is provide to disable this optimization as in can cause problems with certain types of queries that require dynamic SQL based on their arguments.These queries include:
- Expressions that make use of 'equal' where the argument value has the potential to be null, this can cause problems on databases that require IS NULL, instead of = NULL.
- Expressions that make use of 'in' and that use parameter binding, this will cause problems as the in values must be bound individually.
-
setShouldRetrieveBypassCache
public void setShouldRetrieveBypassCache(boolean shouldRetrieveBypassCache)
ADVANCED: JPA flag used to control the behavior of the shared cache. This flag specifies the behavior when data is retrieved by the find methods and by the execution of queries.
-
setShouldReturnGeneratedKeys
public void setShouldReturnGeneratedKeys(boolean shouldReturnGeneratedKeys)
ADVANCED: JPA flag used to control the behavior of IDENTITY generation. This flag specifies the behavior when data is retrieved by the find methods and by the execution of queries.This flag is only applicable to Insert queries and will only apply if the database platform supports
Statement.RETURN_GENERATED_KEYS
-
setShouldStoreBypassCache
public void setShouldStoreBypassCache(boolean shouldStoreBypassCache)
ADVANCED: JPA flag used to control the behavior of the shared cache. This flag specifies the behavior when data is read from the database and when data is committed into the database.
-
setShouldValidateUpdateCallCacheUse
public void setShouldValidateUpdateCallCacheUse(boolean shouldCheckUpdateCallCacheUse)
INTERNAL: Set if additional validation should be performed before the query uses the update call cache.
-
setShouldUseWrapperPolicy
public void setShouldUseWrapperPolicy(boolean shouldUseWrapperPolicy)
ADVANCED: The wrapper policy can be enable on a query.
-
setSourceMapping
public void setSourceMapping(DatabaseMapping sourceMapping)
INTERNAL:
-
setSQLStatement
public void setSQLStatement(org.eclipse.persistence.internal.expressions.SQLStatement sqlStatement)
PUBLIC: To any user of this object. Set the SQL statement of the query. This method should only be used when dealing with statement objects.
-
setSQLString
public void setSQLString(java.lang.String sqlString)
PUBLIC: To any user of this object. Set the SQL string of the query. This method should only be used when dealing with user defined SQL strings. If arguments are required in the string they will be preceded by "#" then the argument name. Warning: Allowing an unverified SQL string to be passed into this method makes your application vulnerable to SQL injection attacks.
-
setTranslationRow
public void setTranslationRow(org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)
INTERNAL: Set the row for translation
-
shouldBindAllParameters
public boolean shouldBindAllParameters()
PUBLIC: Bind all arguments to any SQL statement.
-
shouldAllowNativeSQLQuery
public boolean shouldAllowNativeSQLQuery(boolean projectAllowsNativeQueries)
INTERNAL: Return true if this individual query should allow native a SQL call to be issued.
-
shouldCacheStatement
public boolean shouldCacheStatement()
PUBLIC: Cache the prepared statements, this requires full parameter binding as well.
-
shouldCascadeAllParts
public boolean shouldCascadeAllParts()
PUBLIC: Flag used to determine if all parts should be cascaded
-
shouldCascadeByMapping
public boolean shouldCascadeByMapping()
PUBLIC: Mappings should be checked to determined if the current operation should be cascaded to the objects referenced.
-
shouldCascadeOnlyDependentParts
public boolean shouldCascadeOnlyDependentParts()
INTERNAL: Flag used for unit of works cascade policy.
-
shouldCascadeParts
public boolean shouldCascadeParts()
PUBLIC: Flag used to determine if any parts should be cascaded
-
shouldCascadePrivateParts
public boolean shouldCascadePrivateParts()
PUBLIC: Flag used to determine if any private parts should be cascaded
-
shouldCloneCall
public boolean shouldCloneCall()
INTERNAL: Flag used to determine if the call needs to be cloned.
-
shouldIgnoreBindAllParameters
public boolean shouldIgnoreBindAllParameters()
PUBLIC: Local shouldBindAllParameters() should be ignored, Session's shouldBindAllParameters() should be used.
-
shouldIgnoreCacheStatement
public boolean shouldIgnoreCacheStatement()
PUBLIC: Local shouldCacheStatement() should be ignored, Session's shouldCacheAllStatements() should be used.
-
shouldMaintainCache
public boolean shouldMaintainCache()
PUBLIC: Return if the identity map (cache) should be used or not. If not the cache check will be skipped and the result will not be put into the identity map. By default the identity map is always maintained.
-
shouldPrepare
public boolean shouldPrepare()
PUBLIC: Return if the query should be prepared. EclipseLink automatically prepares queries to generate their SQL only once, one each execution of the query the SQL does not need to be generated again only the arguments need to be translated. This option is provide to disable this optimization as in can cause problems with certain types of queries that require dynamic SQL based on their arguments.These queries include:
- Expressions that make use of 'equal' where the argument value has the potential to be null, this can cause problems on databases that require IS NULL, instead of = NULL.
- Expressions that make use of 'in' and that use parameter binding, this will cause problems as the in values must be bound individually.
-
shouldPrepare
public boolean shouldPrepare(org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Check if the query should be prepared, or dynamic, depending on the arguments. This allows null parameters to affect the SQL, such as stored procedure default values, or IS NULL, or insert defaults.
-
shouldRetrieveBypassCache
public boolean shouldRetrieveBypassCache()
ADVANCED: JPA flag used to control the behavior of the shared cache. This flag specifies the behavior when data is retrieved by the find methods and by the execution of queries.
-
shouldReturnGeneratedKeys
public boolean shouldReturnGeneratedKeys()
ADVANCED: JPA flag used to control the behavior of IDENTITY generation. This flag specifies the behavior when data is retrieved by the find methods and by the execution of queries.This flag is only applicable to Insert queries and will only apply if the database platform supports
Statement.RETURN_GENERATED_KEYS
-
shouldStoreBypassCache
public boolean shouldStoreBypassCache()
ADVANCED: JPA flag used to control the behavior of the shared cache. This flag specifies the behavior when data is read from the database and when data is committed into the database.
-
shouldUseWrapperPolicy
public boolean shouldUseWrapperPolicy()
ADVANCED: The wrapper policy can be enabled on a query.
-
shouldValidateUpdateCallCacheUse
public boolean shouldValidateUpdateCallCacheUse()
ADVANCED: Return true if additional validation should be performed before the query uses the update call cache, false otherwise.
-
storeBypassCache
public void storeBypassCache()
ADVANCED: JPA flag used to control the behavior of the shared cache. This flag specifies the behavior when data is read from the database and when data is committed into the database. Calling this method will set a store bypass to true. Note: For a cache store mode of REFRESH, see refreshIdentityMapResult() from ObjectLevelReadQuery.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
setIsNativeConnectionRequired
public void setIsNativeConnectionRequired(boolean isNativeConnectionRequired)
ADVANCED: Set if the descriptor requires usage of a native (unwrapped) JDBC connection. This may be required for some Oracle JDBC support when a wrapping DataSource is used.
-
isNativeConnectionRequired
public boolean isNativeConnectionRequired()
ADVANCED: Return if the descriptor requires usage of a native (unwrapped) JDBC connection. This may be required for some Oracle JDBC support when a wrapping DataSource is used.
-
getDoNotRedirect
public boolean getDoNotRedirect()
This method is used in combination with redirected queries. If a redirector is set on the query or there is a default redirector on the Descriptor setting this value to true will force EclipseLink to ignore the redirector during execution. This setting will be used most often when reexecuting the query within a redirector.
-
setDoNotRedirect
public void setDoNotRedirect(boolean doNotRedirect)
This method is used in combination with redirected queries. If a redirector is set on the query or there is a default redirector on the Descriptor setting this value to true will force EclipseLink to ignore the redirector during execution. This setting will be used most often when reexecuting the query within a redirector.
-
getBatchObjects
public java.util.Map<java.lang.Object,java.lang.Object> getBatchObjects()
INTERNAL: Return temporary map of batched objects.
-
setBatchObjects
public void setBatchObjects(java.util.Map<java.lang.Object,java.lang.Object> batchObjects)
INTERNAL: Set temporary map of batched objects.
-
setAllowNativeSQLQuery
public void setAllowNativeSQLQuery(java.lang.Boolean allowNativeSQLQuery)
INTERNAL: Set to true if this individual query should be marked to bypass a persistence unit level disallow SQL queries flag.
-
hasNullableArguments
public boolean hasNullableArguments()
INTERNAL: Return if the query has any nullable arguments.
-
getNullableArguments
public java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> getNullableArguments()
INTERNAL: Return the list of arguments to check for null. If any are null, the query needs to be re-prepared.
-
setNullableArguments
public void setNullableArguments(java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> nullableArguments)
INTERNAL: Set the list of arguments to check for null. If any are null, the query needs to be re-prepared.
-
-