public abstract class ObjectLevelReadQuery extends ObjectBuildingQuery
Purpose: Abstract class for all read queries using objects.
Description: Contains common behavior for all read queries using objects.
DatabaseQuery.ParameterType
Modifier and Type | Field and Description |
---|---|
static int |
CheckCacheByExactPrimaryKey |
static int |
CheckCacheByPrimaryKey |
static int |
CheckCacheOnly |
static int |
CheckCacheThenDatabase |
static int |
ConformResultsInUnitOfWork |
static int |
DoNotCheckCache |
static short |
DONT_USE_DISTINCT |
static boolean |
isResultSetAccessOptimizedQueryDefault
If neither query specifies isResultSetOptimizedQuery nor session specifies shouldOptimizeResultSetAccess then this value is used to indicate whether optimization should be attempted
|
static java.lang.String |
NONE
Names of the possible lock mode types, JPA 2.0 only
|
static java.lang.String |
OPTIMISTIC |
static java.lang.String |
OPTIMISTIC_FORCE_INCREMENT |
static java.lang.String |
PESSIMISTIC_ |
static java.lang.String |
PESSIMISTIC_FORCE_INCREMENT |
static java.lang.String |
PESSIMISTIC_READ |
static java.lang.String |
PESSIMISTIC_WRITE |
static java.lang.String |
READ
Names of the possible lock mode types, JPA 1.0 and 2.0
|
static boolean |
shouldUseSerializedObjectPolicyDefault
default value for shouldUseSerializedObjectPolicy
|
static short |
UNCOMPUTED_DISTINCT |
static short |
USE_DISTINCT |
static int |
UseDescriptorSetting |
static java.lang.String |
WRITE |
DEFAULT_LOCK_MODE, LOCK, LOCK_NOWAIT, LOCK_RESULT_PROPERTY, NO_LOCK
BATCH_FETCH_PROPERTY, CascadeAggregateDelete, CascadeAllParts, CascadeByMapping, CascadeDependentParts, CascadePrivateParts, NoCascading
Constructor and Description |
---|
ObjectLevelReadQuery()
INTERNAL: Initialize the state of the query
|
Modifier and Type | Method and Description |
---|---|
void |
acquireLocks()
PUBLIC: Set the query to lock, this will also turn refreshCache on.
|
void |
acquireLocksWithoutWaiting()
PUBLIC: Set the query to lock without waiting (blocking), this will also turn refreshCache on.
|
void |
addAdditionalField(org.eclipse.persistence.internal.helper.DatabaseField field)
INTERNAL: Additional fields can be added to a query.
|
void |
addAdditionalField(Expression fieldExpression)
INTERNAL: Additional fields can be added to a query.
|
void |
addBatchReadAttribute(Expression attributeExpression)
PUBLIC: Specify the foreign-reference mapped attribute to be optimized in this query.
|
void |
addBatchReadAttribute(java.lang.String attributeName)
PUBLIC: Specify the foreign-reference mapped attribute to be optimized in this query.
|
void |
addDescendingOrdering(java.lang.String queryKeyName)
PUBLIC: Order the query results by the object's attribute or query key name.
|
void |
addJoinedAttribute(Expression attributeExpression)
PUBLIC: Specify the attribute to be join fetched in this query.
|
void |
addJoinedAttribute(java.lang.String attributeName)
PUBLIC: Specify the relationship attribute to be join fetched in this query.
|
void |
addJoinSelectionFields(java.util.Vector fields, boolean isCustomSQL)
INTERNAL: The method adds to the passed input vector the fields or expressions corresponding to the joins.
|
void |
addNonFetchJoin(Expression target)
PUBLIC: Specify the object expression to be joined in this query.
|
void |
addNonFetchJoinedAttribute(Expression attributeExpression)
PUBLIC: Specify the relationship attribute to be join in this query.
|
void |
addNonFetchJoinedAttribute(java.lang.String attributeName)
PUBLIC: Specify the relationship attribute to be join in this query.
|
void |
addOrdering(Expression orderingExpression)
PUBLIC: Add the ordering expression.
|
void |
addPartialAttribute(Expression attributeExpression)
Deprecated.
since EclipseLink 2.1, partial attributes replaced by fetch groups.
|
void |
addPartialAttribute(java.lang.String attributeName)
Deprecated.
since EclipseLink 2.1, partial attributes replaced by fetch groups.
|
void |
addUnionExpression(Expression union)
PUBLIC: Add the union expression to the query.
|
java.lang.Object |
buildObject(org.eclipse.persistence.internal.sessions.AbstractRecord row)
INTERNAL: Used to build the object, and register it if in the context of a unit of work.
|
void |
changeDescriptor(org.eclipse.persistence.internal.sessions.AbstractSession theSession)
INTERNAL: The reference class has been changed, need to reset the descriptor.
|
void |
checkCacheOnly()
PUBLIC: The cache will checked completely, if the object is not found null will be returned or an error if the query is too complex.
|
void |
checkDescriptor(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Ensure that the descriptor has been set.
|
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.
|
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.
|
void |
checkPrePrepare(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: ObjectLevelReadQueries now have an explicit pre-prepare stage, which is for checking for pessimistic locking, and computing any joined attributes declared on the descriptor.
|
void |
clearIsResultSetOptimizedQuery()
ADVANCED: Clear the flag set by setIsResultSetOptimizedQuery method, allow to use default set on the session instead.
|
void |
clearUsesResultSetAccessOptimization()
INTERNAL:
|
java.lang.Object |
clone()
INTERNAL: Clone the query
|
void |
computeBatchReadMappingQueries()
INTERNAL: Used to optimize joining by pre-computing the nested join queries for the mappings.
|
void |
conformResultsInUnitOfWork()
PUBLIC: The cache will checked completely, if the object is not found the database will be queried, and the database result will be verified with what is in the cache and/or unit of work including new objects.
|
void |
copyFromQuery(DatabaseQuery query)
INTERNAL: Copy all setting from the query.
|
java.lang.Object |
deepClone()
INTERNAL: Clone the query, including its selection criteria.
|
void |
dontAcquireLocks()
PUBLIC: Set the query not to lock.
|
void |
dontCheckCache()
PUBLIC: This can be used to explicitly disable the cache hit.
|
void |
dontRefreshIdentityMapResult()
PUBLIC: When unset means perform read normally and dont do refresh.
|
void |
dontRefreshRemoteIdentityMapResult()
PUBLIC: When unset means perform read normally and dont do refresh.
|
void |
dontUseDistinct()
ADVANCED: If a distinct has been set the DISTINCT clause will be printed.
|
boolean |
equals(java.lang.Object object)
INTERNAL: Return if the query is equal to the other.
|
void |
except(ReportQuery query)
PUBLIC: Except the query results with the other query.
|
java.lang.Object |
execute(org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)
INTERNAL: Execute the query.
|
java.lang.Object |
executeDatabaseQuery()
INTERNAL: Executes the prepared query on the datastore.
|
java.lang.Object |
executeInUnitOfWork(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)
INTERNAL: Execute the query in the unit of work.
|
void |
extendPessimisticLockScope()
INTERNAL: Extends pessimistic lock scope.
|
java.util.List<java.lang.Object> |
getAdditionalFields()
INTERNAL: Additional fields can be added to a query.
|
AsOfClause |
getAsOfClause()
ADVANCED: Answers the past time this query is as of.
|
BatchFetchPolicy |
getBatchFetchPolicy()
Return the batch fetch policy for configuring batch fetching.
|
java.util.Map<java.lang.Object,java.lang.Object> |
getBatchObjects()
INTERNAL: Return temporary map of batched objects.
|
java.util.List<Expression> |
getBatchReadAttributeExpressions()
INTERNAL: Return all attributes specified for batch reading.
|
int |
getCacheUsage()
PUBLIC: Return the cache usage.
|
java.util.Map<java.lang.Class,org.eclipse.persistence.internal.databaseaccess.DatabaseCall> |
getConcreteSubclassCalls()
INTERNAL: Return the cache of concrete subclass calls.
|
java.util.Map<java.lang.Class,java.util.Map<DatabaseMapping,java.lang.Object>> |
getConcreteSubclassJoinedMappingIndexes()
INTERNAL: Return the cache of concrete subclass joined mapping indexes.
|
short |
getDistinctState()
ADVANCED: If a distinct has been set the DISTINCT clause will be printed.
|
java.lang.Object |
getExampleObject()
PUBLIC: This method returns the current example object.
|
FetchGroup |
getExecutionFetchGroup()
INTERNAL: Returns FetchGroup that will be applied to the query.
|
FetchGroup |
getExecutionFetchGroup(ClassDescriptor descriptor)
INTERNAL: Returns FetchGroup that will be applied to the query.
|
ExpressionBuilder |
getExpressionBuilder()
REQUIRED: Get the expression builder which should be used for this query.
|
FetchGroup |
getFetchGroup()
Return the fetch group set in the query.
|
java.lang.String |
getFetchGroupName()
Return the fetch group name set in the query.
|
java.util.Set<org.eclipse.persistence.internal.helper.DatabaseField> |
getFetchGroupNonNestedFieldsSet()
INTERNAL: Return the set of fields required in the select clause, for fetch group reading.
|
java.util.Set<org.eclipse.persistence.internal.helper.DatabaseField> |
getFetchGroupNonNestedFieldsSet(DatabaseMapping nestedMapping)
INTERNAL: Return the set of fields required in the select clause, for fetch group reading.
|
java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> |
getFetchGroupSelectionFields()
INTERNAL: Return the fields required in the select clause, for fetch group reading.
|
InMemoryQueryIndirectionPolicy |
getInMemoryQueryIndirectionPolicy()
PUBLIC: Returns the InMemoryQueryIndirectionPolicy for this query
|
int |
getInMemoryQueryIndirectionPolicyState()
PUBLIC: Returns the InMemoryQueryIndirectionPolicy for this query
|
java.util.List |
getJoinedAttributeExpressions()
INTERNAL: Convenience method for project mapping.
|
org.eclipse.persistence.internal.queries.JoinedAttributeManager |
getJoinedAttributeManager()
INTERNAL: Return join manager responsible for managing all aspects of joining for the query.
|
LoadGroup |
getLoadGroup()
Return the load group set in the query.
|
org.eclipse.persistence.internal.expressions.ForUpdateClause |
getLockingClause()
INTERNAL: It is not exactly as simple as a query being either locking or not.
|
java.lang.String |
getLockModeType()
INTERNAL: returns the javax.persistence.LockModeType string value set on this query.
|
java.util.List<Expression> |
getNonFetchJoinAttributeExpressions()
INTERNAL: Return the attributes that must be joined, but not fetched, that is, do not trigger the value holder.
|
java.util.List<Expression> |
getOrderByExpressions()
INTERNAL: Return the order expressions for the query.
|
java.util.List<Expression> |
getPartialAttributeExpressions()
INTERNAL: Return the partial attributes to select.
|
java.util.Vector |
getPartialAttributeSelectionFields(boolean isCustomSQL)
INTERNAL: Return the fields required in the select clause, for patial attribute reading.
|
QueryByExamplePolicy |
getQueryByExamplePolicy()
PUBLIC: When using Query By Example, an instance of QueryByExamplePolicy is used to customize the query.
|
java.lang.Class |
getReferenceClass()
PUBLIC: Return the reference class of the query.
|
java.lang.String |
getReferenceClassName()
INTERNAL: Return the reference class of the query.
|
java.util.Vector |
getSelectionFields()
INTERNAL: Return the fields selected by the query.
|
java.util.List<Expression> |
getUnionExpressions()
Return any union expressions.
|
java.lang.Integer |
getWaitTimeout()
PUBLIC: Return the WAIT timeout value of pessimistic locking query.
|
boolean |
hasAdditionalFields()
INTERNAL: Return if additional field.
|
boolean |
hasAsOfClause()
PUBLIC: Answers if the domain objects are to be read as of a past time.
|
boolean |
hasBatchReadAttributes()
INTERNAL: Return true is this query has batching
|
boolean |
hasDefaultBuilder()
INTERNAL: Checks to see if a builder has been set on the query.
|
boolean |
hasExecutionFetchGroup()
INTERNAL: Indicates whether a FetchGroup will be applied to the query.
|
boolean |
hasFetchGroup()
Return if a fetch group is set in the query.
|
int |
hashCode()
INTERNAL: Compute a consistent hash-code for the expression.
|
boolean |
hasJoining()
INTERNAL: Return if any attributes are joined.
|
boolean |
hasNonFetchJoinedAttributeExpressions()
INTERNAL: Return the attributes that must be joined.
|
boolean |
hasOrderByExpressions()
INTERNAL: The order bys are lazy initialized to conserve space.
|
boolean |
hasPartialAttributeExpressions()
INTERNAL: Return if partial attributes.
|
boolean |
hasUnionExpressions()
INTERNAL: The unions are lazy initialized to conserve space.
|
void |
intersect(ReportQuery query)
PUBLIC: Intersect the query results with the other query.
|
boolean |
isAttributeBatchRead(ClassDescriptor mappingDescriptor, java.lang.String attributeName)
INTERNAL: Return if the attribute is specified for batch reading.
|
boolean |
isCachedExpressionQuery()
INTERNAL: Indicates whether the query is cached as an expression query in descriptor's query manager.
|
boolean |
isClonePessimisticLocked(java.lang.Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
INTERNAL: Helper method that checks if clone has been locked with uow.
|
boolean |
isDefaultLock()
INTERNAL: Helper method to determine the default mode.
|
boolean |
isDefaultPropertiesQuery()
INTERNAL: Return true if the query uses default properties.
|
boolean |
isDistinctComputed()
INTERNAL: return true if this query has computed its distinct value already
|
boolean |
isLockQuery()
PUBLIC: Answers if the query lock mode is known to be LOCK or LOCK_NOWAIT.
|
boolean |
isLockQuery(Session session)
ADVANCED: Answers if this query will issue any pessimistic locks.
|
boolean |
isObjectLevelReadQuery()
PUBLIC: Return if this is an object level read query.
|
boolean |
isPartialAttribute(java.lang.String attributeName)
INTERNAL: Return if partial attribute.
|
boolean |
isPrimaryKeyQuery()
INTERNAL: Return if the query is known to be by primary key.
|
boolean |
isReadOnly()
PUBLIC: Return if the query is read-only.
|
java.lang.Boolean |
isResultSetAccessOptimizedQuery()
ADVANCED: Return if the query result set access should be optimized.
|
boolean |
isResultSetOptimizedQuery()
ADVANCED: Return if the query should be optimized to build directly from the result set.
|
void |
prepareFetchGroup()
INTERNAL: Add mandatory attributes to fetch group, create entityFetchGroup.
|
void |
prepareFromQuery(DatabaseQuery query)
INTERNAL: Prepare the query from the prepared query.
|
DatabaseQuery |
prepareOutsideUnitOfWork(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: There is a very special case where a query may be a bean-level pessimistic locking query.
|
void |
recordCloneForPessimisticLocking(java.lang.Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
INTERNAL: Helper method that records clone with uow if query is pessimistic locking.
|
void |
refreshIdentityMapResult()
PUBLIC: Refresh the attributes of the object(s) resulting from the query.
|
void |
refreshRemoteIdentityMapResult()
PUBLIC: Refresh the attributes of the object(s) resulting from the query.
|
abstract java.lang.Object |
registerResultInUnitOfWork(java.lang.Object result, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractRecord arguments, boolean buildDirectlyFromRows)
INTERNAL: All objects queried via a UnitOfWork get registered here.
|
void |
resetDistinct()
ADVANCED: If a distinct has been set the DISTINCT clause will be printed.
|
void |
setAdditionalFields(java.util.List<java.lang.Object> additionalFields)
INTERNAL: Additional fields can be added to a query.
|
void |
setAsOfClause(AsOfClause pastTime)
ADVANCED: Sets the query to execute as of the past time.
|
void |
setBatchFetchPolicy(BatchFetchPolicy batchFetchPolicy)
Set the batch fetch policy for configuring batch fetching.
|
void |
setBatchFetchSize(int size)
PUBLIC: Set the batch fetch size for the query.
|
void |
setBatchFetchType(BatchFetchType type)
PUBLIC: Set the batch fetch type for the query.
|
void |
setBatchObjects(java.util.Map<java.lang.Object,java.lang.Object> batchObjects)
INTERNAL: Set temporary map of batched objects.
|
void |
setBatchReadAttributeExpressions(java.util.List<Expression> attributeExpressions)
INTERNAL: Set all attributes specified for batch reading.
|
void |
setCacheUsage(int cacheUsage)
PUBLIC: Set the cache usage.
|
void |
setDescriptor(ClassDescriptor descriptor)
INTERNAL: Set the descriptor for the query.
|
void |
setDistinctState(short distinctState)
ADVANCED: If a distinct has been set the DISTINCT clause will be printed.
|
void |
setEJBQLString(java.lang.String ejbqlString)
PUBLIC: Set the EJBQL string of the query.
|
void |
setExampleObject(java.lang.Object newExampleObject)
PUBLIC: Set the example object of the query to be the newExampleObject.
|
void |
setExpressionBuilder(ExpressionBuilder builder)
INTERNAL Sets the default expression builder for this query.
|
void |
setFetchGroup(FetchGroup newFetchGroup)
Set a dynamic (use case) fetch group to the query.
|
void |
setFetchGroupName(java.lang.String groupName)
Set a descriptor-level pre-defined named fetch group to the query.
|
void |
setInMemoryQueryIndirectionPolicy(InMemoryQueryIndirectionPolicy inMemoryQueryIndirectionPolicy)
PUBLIC: Set the InMemoryQueryIndirectionPolicy for this query.
|
void |
setInMemoryQueryIndirectionPolicyState(int inMemoryQueryIndirectionPolicy)
PUBLIC: Set the InMemoryQueryIndirectionPolicy for this query.
|
void |
setIsPrepared(boolean isPrepared)
INTERNAL: Clear cached flags when un-preparing.
|
void |
setIsPrePrepared(boolean isPrePrepared)
INTERNAL: If changes are made to the query that affect the derived SQL or Call parameters the query needs to be prepared again.
|
void |
setIsReadOnly(boolean isReadOnly)
PUBLIC: Set the query to be read-only.
|
void |
setIsResultSetAccessOptimizedQuery(boolean isResultSetAccessOptimizedQuery)
ADVANCED: Set if the query should be optimized to build directly from the result set.
|
void |
setIsResultSetOptimizedQuery(boolean isResultSetOptimizedQuery)
ADVANCED: Set if the query should be optimized to build directly from the result set.
|
void |
setJoinedAttributeExpressions(java.util.List expressions)
INTERNAL: Convenience method for project mapping.
|
void |
setJoinedAttributeManager(org.eclipse.persistence.internal.queries.JoinedAttributeManager joinedAttributeManager)
INTERNAL: Set join manager responsible for managing all aspects of joining for the query.
|
void |
setLoadGroup(LoadGroup loadGroup)
Set a load group to the query.
|
void |
setLockingClause(org.eclipse.persistence.internal.expressions.ForUpdateClause clause)
INTERNAL: The locking clause contains a list of expressions representing which objects are to be locked by the query.
|
void |
setLockMode(short lockMode)
PUBLIC: Sets whether this is a pessimistically locking query.
|
boolean |
setLockModeType(java.lang.String lockModeType, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Sets a javax.persistence.LockModeType to used with this queries execution.
|
void |
setNonFetchJoinAttributeExpressions(java.util.List<Expression> nonFetchJoinExpressions)
INTERNAL: Return the attributes that must be joined, but not fetched, that is, do not trigger the value holder.
|
void |
setOrderByExpressions(java.util.List<Expression> orderByExpressions)
INTERNAL: Set the order expressions for the query.
|
void |
setPartialAttributeExpressions(java.util.List<Expression> partialAttributeExpressions)
INTERNAL: Set the partial attributes to select.
|
void |
setQueryByExamplePolicy(QueryByExamplePolicy queryByExamplePolicy)
PUBLIC: The QueryByExamplePolicy, is a useful to customize the query when Query By Example is used.
|
void |
setReferenceClass(java.lang.Class aClass)
REQUIRED: Set the reference class for the query.
|
void |
setReferenceClassName(java.lang.String aClass)
INTERNAL: Set the reference class for the query.
|
void |
setSelectionCriteria(Expression expression)
PUBLIC: Set the Expression/where clause of the query.
|
void |
setShouldExtendPessimisticLockScope(boolean isExtended)
INTERNAL: Indicates whether pessimistic lock should also be applied to relation tables (ManyToMany and OneToOne mappings), reference tables (DirectCollection and AggregateCollection mapping).
|
void |
setShouldFilterDuplicates(boolean shouldFilterDuplicates)
PUBLIC: Set if duplicate rows should be filter when using 1-m joining.
|
void |
setShouldIncludeData(boolean shouldIncludeData)
INTERNAL: Set if the rows for the result of the query should also be returned using a complex query result.
|
void |
setShouldOuterJoinSubclasses(boolean shouldOuterJoinSubclasses)
PUBLIC: Set if an outer join should be used to read subclasses.
|
void |
setShouldUseDefaultFetchGroup(boolean shouldUseDefaultFetchGroup)
Set false if the user does not want to use the default fetch group defined in the descriptor level.
|
void |
setShouldUseSerializedObjectPolicy(boolean shouldUseSerializedObjectPolicy)
INTERNAL: Set a flag that indicates whether the query should use SerializedObjectPolicy if descriptor has it.
|
void |
setUnionExpressions(java.util.List<Expression> unionExpressions)
INTERNAL: Set any union expressions.
|
void |
setWaitTimeout(java.lang.Integer waitTimeout)
PUBLIC: Sets that this a pessimistic wait locking query.
|
boolean |
shouldCheckCache()
PUBLIC: Return if the cache should be checked.
|
boolean |
shouldCheckCacheOnly()
PUBLIC: Return if cache should be checked.
|
boolean |
shouldCheckDescriptorForCacheUsage()
PUBLIC: Return whether the descriptor's disableCacheHits setting should be checked prior to querying the cache.
|
boolean |
shouldConformResultsInUnitOfWork()
PUBLIC: Should the results will be checked against the changes within the unit of work and object no longer matching or deleted will be remove, matching new objects will also be added..
|
boolean |
shouldDistinctBeUsed()
INTERNAL: return true if this query should use a distinct
|
boolean |
shouldExtendPessimisticLockScope()
INTERNAL: Indicates whether pessimistic lock should also be applied to relation tables (ManyToMany and OneToOne mappings), reference tables (DirectCollection and AggregateCollection mapping).
|
boolean |
shouldFilterDuplicates()
PUBLIC: Return if duplicate rows should be filter when using 1-m joining.
|
boolean |
shouldIncludeData()
INTERNAL: Return if the rows for the result of the query should also be returned using a complex query result.
|
boolean |
shouldOuterJoinSubclasses()
PUBLIC: Return if an outer join should be used to read subclasses.
|
boolean |
shouldReadAllMappings()
INTERNAL: Return if this is a full object query, not partial nor fetch group.
|
boolean |
shouldReadMapping(DatabaseMapping mapping, FetchGroup fetchGroup)
INTERNAL: Check if the mapping is part of the partial attributes.
|
boolean |
shouldUseDefaultFetchGroup()
Return false if the query does not use the default fetch group defined in the descriptor level.
|
boolean |
shouldUseSerializedObjectPolicy()
INTERNAL: Indicates whether the query should use SerializedObjectPolicy if descriptor has it.
|
boolean |
supportsResultSetAccessOptimizationOnExecute()
INTERNAL: Indicates whether the query can use ResultSet optimization.
|
boolean |
supportsResultSetAccessOptimizationOnPrepare()
INTERNAL: Indicates whether the query can use ResultSet optimization.
|
java.lang.String |
toString() |
void |
union(ReportQuery query)
PUBLIC: Union the query results with the other query.
|
void |
useDistinct()
ADVANCED: If a distinct has been set the DISTINCT clause will be printed.
|
boolean |
usesResultSetAccessOptimization()
INTERNAL: Return if the query uses ResultSet optimization.
|
convertClassNamesToClasses, getDataResults, getExecutionTime, getLockMode, getPrefetchedCacheKeys, isAttributeJoined, isCacheCheckComplete, isObjectBuildingQuery, isRegisteringResults, postRegisterIndividualResult, registerIndividualResult, requiresDeferredLocks, setExecutionTime, setPrefetchedCacheKeys, setRequiresDeferredLocks, setShouldBuildNullForNullPk, setShouldRefreshIdentityMapResult, setShouldRefreshRemoteIdentityMapResult, setShouldRegisterResultsInUnitOfWork, setShouldUseExclusiveConnection, shouldBuildNullForNullPk, shouldRefreshIdentityMapResult, shouldRefreshRemoteIdentityMapResult, shouldRegisterResultsInUnitOfWork, shouldUseExclusiveConnection
cacheQueryResults, cacheResult, clearQueryResults, doNotCacheQueryResults, getFetchSize, getFirstResult, getInternalMax, getMaxRows, getQueryId, getQueryResultsCachePolicy, getTemporaryCachedQueryResults, isReadQuery, prepareForExecution, remoteExecute, setFetchSize, setFirstResult, setInternalMax, setMaxRows, setQueryId, setQueryResultsCachePolicy, setTemporaryCachedQueryResults, shouldCacheQueryResults
addArgument, addArgument, addArgument, addArgument, addArgument, addArgument, addArgumentByTypeName, addArgumentValue, addArgumentValues, addCall, addStatement, bindAllParameters, buildArgumentFields, cacheStatement, cascadeAllParts, cascadeByMapping, cascadeOnlyDependentParts, cascadePrivateParts, checkPrepare, dontBindAllParameters, dontCacheStatement, dontCascadeParts, dontMaintainCache, extractRemoteResult, getAccessor, getAccessors, getArgumentParameterTypes, getArguments, getArgumentTypeNames, getArgumentTypes, getArgumentValues, getCall, getCascadePolicy, getDatasourceCall, getDatasourceCalls, getDescriptor, getDescriptors, getDomainClassNounName, getDoNotRedirect, getEJBQLString, getExecutionSession, getFlushOnExecute, getHintString, getJPQLString, getMonitorName, getName, getNullableArguments, getParameterDelimiter, getParameterDelimiterChar, getPartitioningPolicy, getProperties, getProperty, getQueryMechanism, getQueryNounName, getQueryTimeout, getRedirector, getRedirectorForQuery, getSelectionCriteria, getSensorName, getSession, getSessionName, getShouldBindAllParameters, getSourceMapping, getSQLStatement, getSQLString, getSQLStrings, getTranslatedSQLString, getTranslatedSQLStrings, getTranslationRow, hasAccessor, hasArguments, hasNullableArguments, hasProperties, hasQueryMechanism, hasSessionName, ignoreBindAllParameters, ignoreCacheStatement, isCallQuery, isCascadeOfAggregateDelete, isCustomQueryUsed, isDataModifyQuery, isDataReadQuery, isDeleteAllQuery, isDeleteObjectQuery, isDirectReadQuery, isExecutionClone, isExpressionQuery, isInsertObjectQuery, isJPQLCallQuery, isModifyAllQuery, isModifyQuery, isNativeConnectionRequired, isObjectLevelModifyQuery, isPrepared, isReadAllQuery, isReadObjectQuery, isReportQuery, isResultSetMappingQuery, isSQLCallQuery, isUpdateAllQuery, isUpdateObjectQuery, isUserDefined, isUserDefinedSQLCall, isValueReadQuery, isWriteObjectQuery, maintainCache, prepareCall, prepareInternal, redirectQuery, removeProperty, replaceValueHoldersIn, resetMonitorName, retrieveBypassCache, rowFromArguments, setAccessor, setAccessors, setAllowNativeSQLQuery, setArguments, setArgumentTypeNames, setArgumentTypes, setArgumentValues, setCall, setCascadePolicy, setDatasourceCall, setDoNotRedirect, setFlushOnExecute, setHintString, setIsExecutionClone, setIsNativeConnectionRequired, setIsUserDefined, setIsUserDefinedSQLCall, setJPQLString, setName, setNullableArguments, setParameterDelimiter, setPartitioningPolicy, setProperties, setProperty, setQueryTimeout, setRedirector, setSession, setSessionName, setShouldBindAllParameters, setShouldBindAllParameters, setShouldCacheStatement, setShouldMaintainCache, setShouldPrepare, setShouldRetrieveBypassCache, setShouldStoreBypassCache, setShouldUseWrapperPolicy, setShouldValidateUpdateCallCacheUse, setSourceMapping, setSQLStatement, setSQLString, setTranslationRow, shouldAllowNativeSQLQuery, shouldBindAllParameters, shouldCacheStatement, shouldCascadeAllParts, shouldCascadeByMapping, shouldCascadeOnlyDependentParts, shouldCascadeParts, shouldCascadePrivateParts, shouldCloneCall, shouldIgnoreBindAllParameters, shouldIgnoreCacheStatement, shouldMaintainCache, shouldPrepare, shouldPrepare, shouldRetrieveBypassCache, shouldStoreBypassCache, shouldUseWrapperPolicy, shouldValidateUpdateCallCacheUse, storeBypassCache
public static final java.lang.String READ
public static final java.lang.String WRITE
public static final java.lang.String NONE
public static final java.lang.String PESSIMISTIC_
public static final java.lang.String PESSIMISTIC_READ
public static final java.lang.String PESSIMISTIC_WRITE
public static final java.lang.String PESSIMISTIC_FORCE_INCREMENT
public static final java.lang.String OPTIMISTIC
public static final java.lang.String OPTIMISTIC_FORCE_INCREMENT
public static final int UseDescriptorSetting
public static final int DoNotCheckCache
public static final int CheckCacheByExactPrimaryKey
public static final int CheckCacheByPrimaryKey
public static final int CheckCacheThenDatabase
public static final int CheckCacheOnly
public static final int ConformResultsInUnitOfWork
public static final short UNCOMPUTED_DISTINCT
public static final short USE_DISTINCT
public static final short DONT_USE_DISTINCT
public static boolean isResultSetAccessOptimizedQueryDefault
public static boolean shouldUseSerializedObjectPolicyDefault
public ObjectLevelReadQuery()
public void union(ReportQuery query)
public void intersect(ReportQuery query)
public void except(ReportQuery query)
public void addUnionExpression(Expression union)
public java.util.List<Expression> getUnionExpressions()
public void setUnionExpressions(java.util.List<Expression> unionExpressions)
public void addDescendingOrdering(java.lang.String queryKeyName)
public void addOrdering(Expression orderingExpression)
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean isReadOnly()
public void setIsReadOnly(boolean isReadOnly)
public void setWaitTimeout(java.lang.Integer waitTimeout)
Fine Grained Locking: On execution the reference class and those of all joined attributes will be checked. If any of these have a PessimisticLockingPolicy set on their descriptor, they will be locked in a SELECT ... FOR UPDATE OF ... {NO WAIT}. Issues fewer locks and avoids setting the lock mode on each query.
Example: readAllQuery.setSelectionCriteria(employee.get("address").equal("Ottawa"));
PessimisticLockingPolicy
public java.lang.Object clone()
clone
in class ObjectBuildingQuery
public java.lang.Object deepClone()
Normally selection criteria are not cloned here as they are cloned later on during prepare.
deepClone
in class ObjectBuildingQuery
public void acquireLocks()
public void acquireLocksWithoutWaiting()
public void addAdditionalField(org.eclipse.persistence.internal.helper.DatabaseField field)
public void addAdditionalField(Expression fieldExpression)
public void addJoinedAttribute(java.lang.String attributeName)
Note: This cannot be used for objects where it is possible not to have a part, as these objects will be omitted from the result set, unless an outer join is used through passing and expression using "getAllowingNull". To join fetch collection relationships use the addJoinedAttribute(Expression) using "anyOf" to "anyOfAllowingNone".
Example: query.addJoinedAttribute("address")
public void addJoinedAttribute(Expression attributeExpression)
Note: This cannot be used for objects where it is possible not to have a part, as these objects will be omitted from the result set, unless an outer join is used through passing and expression using "getAllowingNull".
Example: The following will fetch along with Employee(s) "Jones" all projects they participate in along with teamLeaders and their addresses, teamMembers and their phones. query.setSelectionCriteria(query.getExpressionBuilder().get("lastName").equal("Jones")); Expression projects = query.getExpressionBuilder().anyOf("projects"); query.addJoinedAttribute(projects); Expression teamLeader = projects.get("teamLeader"); query.addJoinedAttribute(teamLeader); Expression teamLeaderAddress = teamLeader.getAllowingNull("address"); query.addJoinedAttribute(teamLeaderAddress); Expression teamMembers = projects.anyOf("teamMembers"); query.addJoinedAttribute(teamMembers); Expression teamMembersPhones = teamMembers.anyOfAllowingNone("phoneNumbers"); query.addJoinedAttribute(teamMembersPhones); Note that: the order is essential: an expression should be added before any expression derived from it; the object is built once - it won't be rebuilt if it to be read again as a joined attribute: in the example the query won't get phones for "Jones" - even though they are among teamMembers (for whom phones are read).
public void addNonFetchJoinedAttribute(java.lang.String attributeName)
Example: query.addNonFetchJoinedAttribute("address")
addNonFetchJoinedAttribute(Expression)
public void addNonFetchJoinedAttribute(Expression attributeExpression)
Example: query.addNonFetchJoinedAttribute(query.getExpressionBuilder().get("teamLeader").get("address"))
addNonFetchJoinedAttribute(Expression)
public void addNonFetchJoin(Expression target)
Example: (select all employees that are a team leader)
ExpressionBuilder project = new ExpressionBuilder(Project.class); ExpressionBuilder employee = new ExpressionBuilder(Employee.class); ReadAllQuery query = new ReadAllQuery(Employee.class, employee); query.addJoin(project.on(project.get("teamLeader").equal(employee)))
public void addPartialAttribute(java.lang.String attributeName)
This allows for the query to be optimized through selecting less data.
Partial objects will be returned from the query, where the unspecified attributes will be left null
. The primary key will always be selected to allow re-querying of the whole object.
Note: Because the object is not fully initialized it cannot be cached, and cannot be edited.
Note: You cannot have 2 partial attributes of the same type. You also cannot add a partial attribute which is of the same type as the class being queried.
Example: query.addPartialAttribute("firstName")
public void setAsOfClause(AsOfClause pastTime)
Equivalent to query.getSelectionCriteria().asOf(pastTime) called immediately before query execution.
An as of clause at the query level will override any clauses set at the expression level. Useful in cases where the selection criteria is not known in advance, such as for query by example or primary key (selection object), or where you do not need to cache the result (report query).
Ideally an as of clause at the session level is superior as query results can then be cached. You must set setShouldMaintainCache(false)
To query all joined/batched attributes as of the same time set this.cascadeAllParts()
.
QueryException
- (at execution time) unless setShouldMaintainCache(false)
is set. If some more recent data were in the cache, this would be returned instead, and both the cache and query result would become inconsistent.hasAsOfClause()
, Session.acquireHistoricalSession(org.eclipse.persistence.history.AsOfClause)
, Expression.asOf(org.eclipse.persistence.history.AsOfClause)
public void addPartialAttribute(Expression attributeExpression)
This allows for the query to be optimized through selecting less data.
Partial objects will be returned from the query, where the unspecified attributes will be left null
. The primary key will always be selected to allow re-querying of the whole object.
Note: Because the object is not fully initialized it cannot be cached, and cannot be edited.
Note: You cannot have 2 partial attributes of the same type. You also cannot add a partial attribute which is of the same type as the class being queried.
Example: query.addPartialAttribute(query.getExpressionBuilder().get("address").get("city"))
public java.lang.Object buildObject(org.eclipse.persistence.internal.sessions.AbstractRecord row)
buildObject
in class ReadQuery
public void checkCacheOnly()
setCacheUsage(int)
public void checkDescriptor(org.eclipse.persistence.internal.sessions.AbstractSession session) throws QueryException
checkDescriptor
in class DatabaseQuery
QueryException
public java.lang.Object checkEarlyReturn(org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)
checkEarlyReturn
in class DatabaseQuery
public void checkPrepare(org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, boolean force)
checkPrepare
in class DatabaseQuery
public void checkPrePrepare(org.eclipse.persistence.internal.sessions.AbstractSession session)
public void changeDescriptor(org.eclipse.persistence.internal.sessions.AbstractSession theSession)
public void conformResultsInUnitOfWork()
setCacheUsage(int)
public void dontAcquireLocks()
public void dontCheckCache()
public void dontRefreshIdentityMapResult()
dontRefreshIdentityMapResult
in class ObjectBuildingQuery
public void dontRefreshRemoteIdentityMapResult()
dontRefreshRemoteIdentityMapResult
in class ObjectBuildingQuery
public void dontUseDistinct()
public DatabaseQuery prepareOutsideUnitOfWork(org.eclipse.persistence.internal.sessions.AbstractSession session)
If that is so, only queries executed inside of a UnitOfWork should have a locking clause. In the extremely rare case that we execute a locking query outside of a UnitOfWork, must disable locking so that we do not get a fetch out of sequence error.
public java.lang.Object execute(org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow) throws DatabaseException, OptimisticLockException
execute
in class DatabaseQuery
session
- - the session in which the receiver will be executed.DatabaseException
- - an error has occurred on the database.OptimisticLockException
- - an error has occurred using the optimistic lock feature.public java.lang.Object executeDatabaseQuery() throws DatabaseException
executeDatabaseQuery
in class DatabaseQuery
DatabaseException
- - an error has occurred on the database.public java.lang.Object executeInUnitOfWork(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow) throws DatabaseException, OptimisticLockException
executeInUnitOfWork
in class DatabaseQuery
unitOfWork
- - the session in which the receiver will be executed.translationRow
- - the argumentsDatabaseException
- - an error has occurred on the database.OptimisticLockException
- - an error has occurred using the optimistic lock feature.public java.util.List<java.lang.Object> getAdditionalFields()
public AsOfClause getAsOfClause()
null
if no clause set, AsOfClause.NO_CLAUSE
if clause explicitly set to null
.AsOfClause
, setAsOfClause(org.eclipse.persistence.history.AsOfClause)
, hasAsOfClause()
public int getCacheUsage()
Valid values are:
public short getDistinctState()
public java.lang.Object getExampleObject()
public ExpressionBuilder getExpressionBuilder()
public void setExpressionBuilder(ExpressionBuilder builder)
public int getInMemoryQueryIndirectionPolicyState()
public InMemoryQueryIndirectionPolicy getInMemoryQueryIndirectionPolicy()
public org.eclipse.persistence.internal.queries.JoinedAttributeManager getJoinedAttributeManager()
public void setJoinedAttributeManager(org.eclipse.persistence.internal.queries.JoinedAttributeManager joinedAttributeManager)
public boolean hasJoining()
public java.util.List getJoinedAttributeExpressions()
public void setJoinedAttributeExpressions(java.util.List expressions)
public java.util.List<Expression> getOrderByExpressions()
public void setOrderByExpressions(java.util.List<Expression> orderByExpressions)
public boolean hasOrderByExpressions()
public boolean hasUnionExpressions()
public boolean shouldFilterDuplicates()
public void setShouldFilterDuplicates(boolean shouldFilterDuplicates)
public org.eclipse.persistence.internal.expressions.ForUpdateClause getLockingClause()
public java.util.List<Expression> getNonFetchJoinAttributeExpressions()
public java.util.List<Expression> getPartialAttributeExpressions()
public QueryByExamplePolicy getQueryByExamplePolicy()
public java.lang.Class getReferenceClass()
getReferenceClass
in class ObjectBuildingQuery
public java.lang.String getReferenceClassName()
getReferenceClassName
in class ObjectBuildingQuery
public boolean hasAsOfClause()
getAsOfClause()
public boolean hasNonFetchJoinedAttributeExpressions()
public boolean hasPartialAttributeExpressions()
hasPartialAttributeExpressions
in class ObjectBuildingQuery
public boolean hasAdditionalFields()
public java.util.Vector getPartialAttributeSelectionFields(boolean isCustomSQL)
public java.util.Set<org.eclipse.persistence.internal.helper.DatabaseField> getFetchGroupNonNestedFieldsSet()
public java.util.Set<org.eclipse.persistence.internal.helper.DatabaseField> getFetchGroupNonNestedFieldsSet(DatabaseMapping nestedMapping)
public java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> getFetchGroupSelectionFields()
public void addJoinSelectionFields(java.util.Vector fields, boolean isCustomSQL)
public java.util.Vector getSelectionFields()
public java.lang.Integer getWaitTimeout()
public boolean isDistinctComputed()
public boolean isLockQuery()
If a single joined attribute was configured for pessimistic locking then this will return true (after first execution) as the SQL contained a FOR UPDATE OF clause.
isLockQuery
in class ObjectBuildingQuery
public boolean isLockQuery(Session session)
If the lock mode is not known (DEFAULT_LOCK_MODE / descriptor specified fine-grained locking) the lock mode will be determined now, to be either LOCK, LOCK_NOWAIT, or NO_LOCK.
isLockQuery()
public boolean isObjectLevelReadQuery()
isObjectLevelReadQuery
in class DatabaseQuery
public boolean isPartialAttribute(java.lang.String attributeName)
public boolean shouldExtendPessimisticLockScope()
public void setIsPrePrepared(boolean isPrePrepared)
Automatically called internally.
The early phase of preparation is to check if this is a pessimistic locking query.
public void setShouldExtendPessimisticLockScope(boolean isExtended)
public void setIsPrepared(boolean isPrepared)
setIsPrepared
in class DatabaseQuery
public void copyFromQuery(DatabaseQuery query)
copyFromQuery
in class ObjectBuildingQuery
public void prepareFromQuery(DatabaseQuery query)
prepareFromQuery
in class ObjectBuildingQuery
public void prepareFetchGroup() throws QueryException
QueryException
public void refreshIdentityMapResult()
refreshIdentityMapResult
in class ObjectBuildingQuery
public void refreshRemoteIdentityMapResult()
refreshRemoteIdentityMapResult
in class ObjectBuildingQuery
public abstract java.lang.Object registerResultInUnitOfWork(java.lang.Object result, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractRecord arguments, boolean buildDirectlyFromRows)
Involves registering the query result individually and in totality, and hence refreshing / conforming is done here.
result
- may be collection (read all) or an object (read one), or even a cursor. If in transaction the shared cache will be bypassed, meaning the result may not be originals from the parent but raw database rows.unitOfWork
- the unitOfWork the result is being registered in.arguments
- the original arguments/parameters passed to the query execution. Used by conformingbuildDirectlyFromRows
- If in transaction must construct a registered result from raw database rows.public void resetDistinct()
public void setAdditionalFields(java.util.List<java.lang.Object> additionalFields)
public boolean shouldCheckCache()
public void setCacheUsage(int cacheUsage)
Valid values are:
public void setDescriptor(ClassDescriptor descriptor)
setDescriptor
in class DatabaseQuery
public void setDistinctState(short distinctState)
public void setExampleObject(java.lang.Object newExampleObject)
If a query already has a selection criteria this criteria and the generated query by example criteria will be conjuncted.
Once a query is executed you must make an explicit call to setExampleObject if the example object is changed, so the query will know to prepare itself again.
There is a caution to setting both a selection criteria and an example object: Only in this case if you set the example object again after execution you must then also reset the selection criteria. (This is because after execution the original criteria and Query By Example criteria were fused together, and the former cannot be easily recovered from the now invalid result).
Restrictions:
#setValidateExample
should be set to true on the corresponding QueryByExamplePolicy to ensure no unsupported relationship types are used in the example.public void setInMemoryQueryIndirectionPolicy(InMemoryQueryIndirectionPolicy inMemoryQueryIndirectionPolicy)
public void setInMemoryQueryIndirectionPolicyState(int inMemoryQueryIndirectionPolicy)
public void setLockMode(short lockMode)
Fine Grained Locking: On execution the reference class and those of all joined attributes will be checked. If any of these have a PessimisticLockingPolicy set on their descriptor, they will be locked in a SELECT ... FOR UPDATE OF ... {NO WAIT}. Issues fewer locks and avoids setting the lock mode on each query.
Example:readAllQuery.setSelectionCriteria(employee.get("address").equal("Ottawa"));
setLockMode
in class ObjectBuildingQuery
PessimisticLockingPolicy
public java.lang.String getLockModeType()
public boolean setLockModeType(java.lang.String lockModeType, org.eclipse.persistence.internal.sessions.AbstractSession session)
public void setNonFetchJoinAttributeExpressions(java.util.List<Expression> nonFetchJoinExpressions)
public void setLockingClause(org.eclipse.persistence.internal.expressions.ForUpdateClause clause)
Use for even finer grained control over what is and is not locked by a particular query.
public void setPartialAttributeExpressions(java.util.List<Expression> partialAttributeExpressions)
public void setEJBQLString(java.lang.String ejbqlString)
DatabaseQuery
setEJBQLString
in class DatabaseQuery
public void setQueryByExamplePolicy(QueryByExamplePolicy queryByExamplePolicy)
Once a query is executed you must make an explicit call to setQueryByExamplePolicy when changing the policy, so the query will know to prepare itself again.
There is a caution to setting both a selection criteria and an example object: If you set the policy after execution you must also reset the selection criteria. (This is because after execution the original criteria and Query By Example criteria are fused together, and the former cannot be easily recovered).
public void setReferenceClass(java.lang.Class aClass)
setReferenceClass
in class ObjectBuildingQuery
public void setReferenceClassName(java.lang.String aClass)
setReferenceClassName
in class ObjectBuildingQuery
public void setSelectionCriteria(Expression expression)
setSelectionCriteria
in class DatabaseQuery
public void setShouldIncludeData(boolean shouldIncludeData)
ComplexQueryResult
public boolean shouldCheckCacheOnly()
public boolean shouldCheckDescriptorForCacheUsage()
public boolean shouldConformResultsInUnitOfWork()
public boolean shouldDistinctBeUsed()
public boolean shouldIncludeData()
ComplexQueryResult
public boolean shouldOuterJoinSubclasses()
public void setShouldOuterJoinSubclasses(boolean shouldOuterJoinSubclasses)
public boolean shouldReadAllMappings()
shouldReadAllMappings
in class ObjectBuildingQuery
public boolean shouldReadMapping(DatabaseMapping mapping, FetchGroup fetchGroup)
shouldReadMapping
in class ObjectBuildingQuery
public void useDistinct()
public boolean isCachedExpressionQuery()
public boolean isClonePessimisticLocked(java.lang.Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
isClonePessimisticLocked
in class ObjectBuildingQuery
public void recordCloneForPessimisticLocking(java.lang.Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
recordCloneForPessimisticLocking
in class ObjectBuildingQuery
public boolean isResultSetOptimizedQuery()
public java.lang.Boolean isResultSetAccessOptimizedQuery()
public boolean usesResultSetAccessOptimization()
usesResultSetAccessOptimization
in class ObjectBuildingQuery
public void clearUsesResultSetAccessOptimization()
public void setIsResultSetOptimizedQuery(boolean isResultSetOptimizedQuery)
public void setIsResultSetAccessOptimizedQuery(boolean isResultSetAccessOptimizedQuery)
public void clearIsResultSetOptimizedQuery()
public boolean isDefaultLock()
isDefaultLock
in class ObjectBuildingQuery
public boolean isDefaultPropertiesQuery()
isDefaultPropertiesQuery
in class ReadQuery
public boolean hasDefaultBuilder()
public boolean hasFetchGroup()
public FetchGroup getFetchGroup()
for named and default FetchGroup lookup.
public LoadGroup getLoadGroup()
getLoadGroup
in class ObjectBuildingQuery
public FetchGroup getExecutionFetchGroup()
getExecutionFetchGroup
in class ObjectBuildingQuery
public FetchGroup getExecutionFetchGroup(ClassDescriptor descriptor)
getExecutionFetchGroup
in class ObjectBuildingQuery
public boolean hasExecutionFetchGroup()
hasExecutionFetchGroup
in class ObjectBuildingQuery
public void setFetchGroup(FetchGroup newFetchGroup)
public void setFetchGroupName(java.lang.String groupName)
public void setLoadGroup(LoadGroup loadGroup)
public java.lang.String getFetchGroupName()
public boolean shouldUseDefaultFetchGroup()
public void setShouldUseDefaultFetchGroup(boolean shouldUseDefaultFetchGroup)
public java.util.Map<java.lang.Class,org.eclipse.persistence.internal.databaseaccess.DatabaseCall> getConcreteSubclassCalls()
public java.util.Map<java.lang.Class,java.util.Map<DatabaseMapping,java.lang.Object>> getConcreteSubclassJoinedMappingIndexes()
public boolean isPrimaryKeyQuery()
public void extendPessimisticLockScope()
public BatchFetchPolicy getBatchFetchPolicy()
public void setBatchFetchPolicy(BatchFetchPolicy batchFetchPolicy)
public java.util.List<Expression> getBatchReadAttributeExpressions()
public void setBatchReadAttributeExpressions(java.util.List<Expression> attributeExpressions)
public boolean hasBatchReadAttributes()
public boolean isAttributeBatchRead(ClassDescriptor mappingDescriptor, java.lang.String attributeName)
public void computeBatchReadMappingQueries()
public void addBatchReadAttribute(java.lang.String attributeName)
Example: query.addBatchReadAttribute("phoneNumbers")
public void addBatchReadAttribute(Expression attributeExpression)
Example: query.addBatchReadAttribute(query.getExpressionBuilder().get("policies").get("claims"))
public void setBatchFetchType(BatchFetchType type)
addBatchReadAttribute(Expression)
public void setBatchFetchSize(int size)
public java.util.Map<java.lang.Object,java.lang.Object> getBatchObjects()
getBatchObjects
in class DatabaseQuery
public void setBatchObjects(java.util.Map<java.lang.Object,java.lang.Object> batchObjects)
setBatchObjects
in class DatabaseQuery
public java.lang.String toString()
toString
in class DatabaseQuery
public boolean supportsResultSetAccessOptimizationOnPrepare()
public boolean supportsResultSetAccessOptimizationOnExecute()
public boolean shouldUseSerializedObjectPolicy()
shouldUseSerializedObjectPolicy
in class ObjectBuildingQuery
public void setShouldUseSerializedObjectPolicy(boolean shouldUseSerializedObjectPolicy)