- All Implemented Interfaces:
- Serializable,- Cloneable
- Direct Known Subclasses:
- ReportQuery
Purpose: Concrete class for all read queries involving a collection of objects.
Responsibilities: Return a container of the objects generated by the query. Implements the inheritance feature when dealing with abstract descriptors
- Since:
- TOPLink/Java 1.0
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumSpecifies the direction in which the hierarchy is traversed in a hierarchical query.Nested classes/interfaces inherited from class org.eclipse.persistence.queries.DatabaseQueryDatabaseQuery.ParameterType
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected Expressionprotected ContainerPolicyUsed for collection and stream support.protected ReadAllQuery.Directionprotected List<Expression> protected ExpressionUsed for Oracle HierarchicalQuery supportFields inherited from class org.eclipse.persistence.queries.ObjectLevelReadQueryadditionalFields, aggregateQueries, batchFetchPolicy, cacheUsage, CheckCacheByExactPrimaryKey, CheckCacheByPrimaryKey, CheckCacheOnly, CheckCacheThenDatabase, concreteSubclassCalls, concreteSubclassJoinedMappingIndexes, concreteSubclassQueries, ConformResultsInUnitOfWork, defaultBuilder, distinctState, DoNotCheckCache, DONT_USE_DISTINCT, fetchGroup, fetchGroupName, inMemoryQueryIndirectionPolicy, isCachedExpressionQuery, isPrePrepared, isReadOnly, isReferenceClassLocked, isResultSetAccessOptimizedQuery, isResultSetAccessOptimizedQueryDefault, isResultSetOptimizedQuery, joinedAttributeManager, loadGroup, lockModeType, NONE, nonFetchJoinAttributeExpressions, OPTIMISTIC, OPTIMISTIC_FORCE_INCREMENT, orderByExpressions, partialAttributeExpressions, PESSIMISTIC_, PESSIMISTIC_FORCE_INCREMENT, PESSIMISTIC_READ, PESSIMISTIC_WRITE, READ, shouldExtendPessimisticLockScope, shouldIncludeData, shouldOuterJoinSubclasses, shouldUseDefaultFetchGroup, shouldUseSerializedObjectPolicy, shouldUseSerializedObjectPolicyDefault, UNCOMPUTED_DISTINCT, unionExpressions, USE_DISTINCT, UseDescriptorSetting, usesResultSetAccessOptimization, waitTimeout, waitTimeoutUnit, WRITEFields inherited from class org.eclipse.persistence.queries.ObjectBuildingQueryDEFAULT_LOCK_MODE, executionTime, isCacheCheckComplete, LOCK, LOCK_NOWAIT, LOCK_RESULT_PROPERTY, lockingClause, NO_LOCK, prefetchedCacheKeys, printInnerJoinInWhereClause, referenceClass, referenceClassName, requiresDeferredLocks, shouldBuildNullForNullPk, shouldRefreshIdentityMapResult, shouldRefreshRemoteIdentityMapResult, shouldRegisterResultsInUnitOfWork, shouldUseExclusiveConnection, wasDefaultLockModeFields inherited from class org.eclipse.persistence.queries.ReadQueryallowQueryResultsCacheValidation, fetchSize, firstResult, maxResults, maxRows, queryId, queryResultCachingPolicy, temporaryCachedQueryResultsFields inherited from class org.eclipse.persistence.queries.DatabaseQueryaccessors, allowNativeSQLQuery, argumentFields, argumentParameterTypes, arguments, argumentTypeNames, argumentTypes, argumentValues, BATCH_FETCH_PROPERTY, CascadeAggregateDelete, CascadeAllParts, CascadeByMapping, CascadeDependentParts, cascadePolicy, CascadePrivateParts, descriptor, descriptors, doNotRedirect, executionSession, flushOnExecute, hintString, isCustomQueryUsed, isExecutionClone, isNativeConnectionRequired, isPrepared, isUserDefined, isUserDefinedSQLCall, monitorName, name, NoCascading, nullableArguments, parameterDelimiter, partitioningPolicy, properties, queryMechanism, queryTimeout, queryTimeoutUnit, redirector, session, sessionName, shouldBindAllParameters, shouldCacheStatement, shouldCloneCall, shouldMaintainCache, shouldPrepare, shouldRetrieveBypassCache, shouldReturnGeneratedKeys, shouldStoreBypassCache, shouldUseWrapperPolicy, shouldValidateUpdateCallCacheUse, sourceMapping, translationRow
- 
Constructor SummaryConstructorsConstructorDescriptionPUBLIC: Return a new read all query.ReadAllQuery(Class<?> classToRead) PUBLIC: Return a new read all query.ReadAllQuery(Class<?> classToRead, Expression selectionCriteria) PUBLIC: Return a new read all query for the class and the selection criteria.ReadAllQuery(Class<?> classToRead, ExpressionBuilder builder) PUBLIC: Return a new read all query for the class.ReadAllQuery(Class<?> classToRead, Call call) PUBLIC: Return a new read all query.ReadAllQuery(Object exampleObject, QueryByExamplePolicy policy) PUBLIC: Return a query by example query to find all objects matching the attributes of the example object.ReadAllQuery(ExpressionBuilder builder) PUBLIC: The expression builder should be provide on creation to ensure only one is used.ReadAllQuery(Call call) PUBLIC: Create a read all query with the database call.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddAscendingOrdering(String queryKeyName) PUBLIC: Order the query results by the object's attribute or query key name.voidcacheResult(Object unwrappedOriginal) INTERNAL:protected BooleancheckCustomQueryFlag(AbstractSession session, AbstractRecord translationRow) INTERNAL: Check and return custom query flag.protected ObjectcheckEarlyReturnLocal(AbstractSession session, AbstractRecord translationRow) INTERNAL: The cache check is done before the prepare as a hit will not require the work to be done.clone()INTERNAL: Creates and returns a copy of this query.protected ObjectconformResult(Object result, UnitOfWorkImpl unitOfWork, AbstractRecord arguments, boolean buildDirectlyFromRows) INTERNAL: Conform the result if specified.booleanINTERNAL: Return if the query is equal to the other.execute(AbstractSession session, AbstractRecord row) INTERNAL: Execute the query.protected ObjectINTERNAL: Execute the query.protected ObjectINTERNAL: Execute the query building the objects directly from the database result-set.extractRemoteResult(Transporter transporter) INTERNAL: Extract the correct query result from the transporter.PUBLIC:INTERNAL: Return the query's container policy.protected QueryRedirectorINTERNAL: Returns the specific default redirector for this query type.PUBLIC:PUBLIC:protected ObjectLevelReadQueryINTERNAL: Get custom all read query from query manager.PUBLIC:booleanINTERNAL: Verify that we have hierarchical query expressionsbooleanINTERNAL: Return true if the query uses default properties.booleanPUBLIC: Return if this is a read all query.protected voidprepare()INTERNAL: Prepare the receiver for execution in a session.protected voidprepareCustomQuery(DatabaseQuery customQuery) INTERNAL: Set the properties needed to be cascaded into the custom query.voidINTERNAL: Prepare the receiver for execution in a session.voidprepareFromQuery(DatabaseQuery query) INTERNAL: Prepare the query from the prepared query.protected voidINTERNAL: Prepare the mechanism.registerResultInUnitOfWork(Object result, UnitOfWorkImpl unitOfWork, AbstractRecord arguments, boolean buildDirectlyFromRows) INTERNAL: All objects queried via a UnitOfWork get registered here.registerResultSetInUnitOfWork(ResultSet resultSet, Vector fields, DatabaseField[] fieldsArray, UnitOfWorkImpl unitOfWork, AbstractRecord arguments) INTERNAL: Version of the previous method for ResultSet optimization.INTERNAL: Execute the query through remote session.replaceValueHoldersIn(Object object, RemoteSessionController controller) INTERNAL: replace the value holders in the specified result object(s)voidsetContainerPolicy(ContainerPolicy containerPolicy) PUBLIC: Set the container policy.voidsetHierarchicalQueryClause(Expression startWith, Expression connectBy, List<Expression> orderSiblingsExpressions) PUBLIC: Set the Hierarchical Query Clause for the queryvoidsetHierarchicalQueryClause(Expression startWith, Expression connectBy, List<Expression> orderSiblingsExpressions, ReadAllQuery.Direction direction) PUBLIC: Set the Hierarchical Query Clause for the query, specifying the hierarchy traversal directionbooleanINTERNAL: Indicates whether the query can use ResultSet optimization.booleanINTERNAL: Indicates whether the query can use ResultSet optimization.voiduseCollectionClass(Class<?> concreteClass) PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.voidPUBLIC: Use a CursoredStream as the result collection.voiduseCursoredStream(int initialReadSize, int pageSize) PUBLIC: Use a CursoredStream as the result collection.voiduseCursoredStream(int initialReadSize, int pageSize, ValueReadQuery sizeQuery) PUBLIC: Use a CursoredStream as the result collection.voiduseMapClass(Class<?> concreteClass, String methodName) PUBLIC: Configure the query to use an instance of the specified container class to hold the result objects.voidPUBLIC: Use a ScrollableCursor as the result collection.voiduseScrollableCursor(int pageSize) PUBLIC: Use a ScrollableCursor as the result collection.voidPUBLIC: Use a ScrollableCursor as the result collection.Methods inherited from class org.eclipse.persistence.queries.ObjectLevelReadQueryacquireLocks, acquireLocksWithoutWaiting, addAdditionalField, addAdditionalField, addBatchReadAttribute, addBatchReadAttribute, addDescendingOrdering, addJoinedAttribute, addJoinedAttribute, addJoinSelectionFields, addNonFetchJoin, addNonFetchJoinedAttribute, addNonFetchJoinedAttribute, addOrdering, addPartialAttribute, addPartialAttribute, addSelectionFieldsForJoinedExpression, addUnionExpression, buildObject, changeDescriptor, checkCacheOnly, checkDescriptor, checkEarlyReturn, checkForCustomQuery, checkPrepare, checkPrePrepare, clearIsResultSetOptimizedQuery, clearUsesResultSetAccessOptimization, computeBatchReadAttributes, computeBatchReadMappingQueries, computeNestedQueriesForBatchReadExpressions, conformIndividualResult, conformResultsInUnitOfWork, copyFromQuery, deepClone, dontAcquireLocks, dontCheckCache, dontRefreshIdentityMapResult, dontRefreshRemoteIdentityMapResult, dontUseDistinct, except, executeDatabaseQuery, executeInUnitOfWork, extendPessimisticLockScope, getAdditionalFields, getAggregateQueries, getAggregateQuery, getAsOfClause, getBatchFetchPolicy, getBatchObjects, getBatchReadAttributeExpressions, getCacheUsage, getConcreteSubclassCalls, getConcreteSubclassJoinedMappingIndexes, getConcreteSubclassQueries, getDistinctState, getExampleObject, getExecutionFetchGroup, getExecutionFetchGroup, getExpressionBuilder, getFetchGroup, getFetchGroupName, getFetchGroupNonNestedFieldsSet, getFetchGroupNonNestedFieldsSet, getFetchGroupSelectionFields, getFetchGroupSelectionFields, getInMemoryQueryIndirectionPolicy, getInMemoryQueryIndirectionPolicyState, getJoinedAttributeExpressions, getJoinedAttributeManager, getLoadGroup, getLockingClause, getLockModeType, getNonFetchJoinAttributeExpressions, getOrderByExpressions, getPartialAttributeExpressions, getPartialAttributeSelectionFields, getQueryByExamplePolicy, getReferenceClass, getReferenceClassName, getSelectionFields, getUnionExpressions, getWaitTimeout, getWaitTimeoutUnit, hasAdditionalFields, hasAsOfClause, hasBatchReadAttributes, hasDefaultBuilder, hasExecutionFetchGroup, hasFetchGroup, hashCode, hasJoining, hasNonFetchJoinedAttributeExpressions, hasOrderByExpressions, hasPartialAttributeExpressions, hasUnionExpressions, initializeDefaultBuilder, intersect, isAttributeBatchRead, isCachedExpressionQuery, isClonePessimisticLocked, isDefaultLock, isDistinctComputed, isLockQuery, isLockQuery, isObjectLevelReadQuery, isPartialAttribute, isPrePrepared, isPrimaryKeyQuery, isReadOnly, isReferenceClassLocked, isResultSetAccessOptimizedQuery, isResultSetOptimizedQuery, prepareFetchGroup, prepareForRemoteExecution, prepareFromCachedQuery, prepareOutsideUnitOfWork, prepareQuery, prepareResultSetAccessOptimization, prePrepare, recordCloneForPessimisticLocking, refreshIdentityMapResult, refreshRemoteIdentityMapResult, resetDistinct, setAdditionalFields, setAggregateQuery, setAsOfClause, setBatchFetchPolicy, setBatchFetchSize, setBatchFetchType, setBatchObjects, setBatchReadAttributeExpressions, setCacheUsage, setDescriptor, setDistinctState, setEJBQLString, setExampleObject, setExpressionBuilder, setFetchGroup, setFetchGroupName, setInMemoryQueryIndirectionPolicy, setInMemoryQueryIndirectionPolicyState, setIsPrepared, setIsPreparedKeepingSubclassData, setIsPrePrepared, setIsReadOnly, setIsResultSetAccessOptimizedQuery, setIsResultSetOptimizedQuery, setJoinedAttributeExpressions, setJoinedAttributeManager, setLoadGroup, setLockingClause, setLockMode, setLockModeType, setNonFetchJoinAttributeExpressions, setOrderByExpressions, setPartialAttributeExpressions, setQueryByExamplePolicy, setReferenceClass, setReferenceClassName, setSelectionCriteria, setShouldExtendPessimisticLockScope, setShouldFilterDuplicates, setShouldIncludeData, setShouldOuterJoinSubclasses, setShouldUseDefaultFetchGroup, setShouldUseSerializedObjectPolicy, setUnionExpressions, setWaitTimeout, setWaitTimeoutUnit, shouldCheckCache, shouldCheckCacheOnly, shouldCheckDescriptorForCacheUsage, shouldConformResultsInUnitOfWork, shouldDistinctBeUsed, shouldExtendPessimisticLockScope, shouldFilterDuplicates, shouldIncludeData, shouldOuterJoinSubclasses, shouldReadAllMappings, shouldReadMapping, shouldUseDefaultFetchGroup, shouldUseSerializedObjectPolicy, toString, union, useDistinct, usesResultSetAccessOptimizationMethods inherited from class org.eclipse.persistence.queries.ObjectBuildingQueryclonedQueryExecutionComplete, convertClassNamesToClasses, getDataResults, getExecutionTime, getLockMode, getPrefetchedCacheKeys, getQueryPrimaryKey, isAttributeJoined, isCacheCheckComplete, isObjectBuildingQuery, isRegisteringResults, postRegisterIndividualResult, printInnerJoinInWhereClause, registerIndividualResult, requiresDeferredLocks, setExecutionTime, setPrefetchedCacheKeys, setPrintInnerJoinInWhereClause, setRequiresDeferredLocks, setShouldBuildNullForNullPk, setShouldRefreshIdentityMapResult, setShouldRefreshRemoteIdentityMapResult, setShouldRegisterResultsInUnitOfWork, setShouldUseExclusiveConnection, setWasDefaultLockMode, shouldBuildNullForNullPk, shouldRefreshIdentityMapResult, shouldRefreshRemoteIdentityMapResult, shouldRegisterResultsInUnitOfWork, shouldUseExclusiveConnection, wasDefaultLockModeMethods inherited from class org.eclipse.persistence.queries.ReadQuerycacheQueryResults, clearQueryResults, doNotCacheQueryResults, getFetchSize, getFirstResult, getInternalMax, getMaxRows, getQueryId, getQueryResults, getQueryResults, getQueryResults, getQueryResultsCachePolicy, getTemporaryCachedQueryResults, isReadQuery, remoteExecute, setAllowQueryResultsCacheValidation, setFetchSize, setFirstResult, setInternalMax, setMaxRows, setQueryId, setQueryResults, setQueryResultsCachePolicy, setTemporaryCachedQueryResults, shouldAllowQueryResultsCacheValidation, shouldCacheQueryResultsMethods inherited from class org.eclipse.persistence.queries.DatabaseQueryaddArgument, addArgument, addArgument, addArgument, addArgument, addArgument, addArgumentByTypeName, addArgumentValue, addArgumentValues, addCall, addStatement, bindAllParameters, buildArgumentFields, buildSelectionCriteria, cacheStatement, cascadeAllParts, cascadeByMapping, cascadeOnlyDependentParts, cascadePrivateParts, checkPrepare, dontBindAllParameters, dontCacheStatement, dontCascadeParts, dontMaintainCache, 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, getQueryTimeoutUnit, 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, isCustomSelectionQuery, isDataModifyQuery, isDataReadQuery, isDeleteAllQuery, isDeleteObjectQuery, isDirectReadQuery, isExecutionClone, isExpressionQuery, isInsertObjectQuery, isJPQLCallQuery, isModifyAllQuery, isModifyQuery, isNativeConnectionRequired, isObjectLevelModifyQuery, isPrepared, isReadObjectQuery, isReportQuery, isResultSetMappingQuery, isSQLCallQuery, isUpdateAllQuery, isUpdateObjectQuery, isUserDefined, isUserDefinedSQLCall, isValueReadQuery, isWriteObjectQuery, maintainCache, prepareCall, prepareInternal, redirectQuery, removeProperty, resetMonitorName, retrieveBypassCache, rowFromArguments, setAccessor, setAccessors, setAllowNativeSQLQuery, setArguments, setArgumentTypeNames, setArgumentTypes, setArgumentValues, setCall, setCascadePolicy, setDatasourceCall, setDoNotRedirect, setExecutionSession, setFlushOnExecute, setHintString, setIsCustomQueryUsed, setIsExecutionClone, setIsNativeConnectionRequired, setIsUserDefined, setIsUserDefinedSQLCall, setJPQLString, setName, setNullableArguments, setParameterDelimiter, setPartitioningPolicy, setProperties, setProperty, setQueryMechanism, setQueryTimeout, setQueryTimeoutUnit, setRedirector, setSession, setSessionName, setShouldBindAllParameters, setShouldBindAllParameters, setShouldCacheStatement, setShouldMaintainCache, setShouldPrepare, setShouldRetrieveBypassCache, setShouldReturnGeneratedKeys, setShouldStoreBypassCache, setShouldUseWrapperPolicy, setShouldValidateUpdateCallCacheUse, setSourceMapping, setSQLStatement, setSQLString, setTranslationRow, shouldAllowNativeSQLQuery, shouldBindAllParameters, shouldCacheStatement, shouldCascadeAllParts, shouldCascadeByMapping, shouldCascadeOnlyDependentParts, shouldCascadeParts, shouldCascadePrivateParts, shouldCloneCall, shouldIgnoreBindAllParameters, shouldIgnoreCacheStatement, shouldMaintainCache, shouldPrepare, shouldPrepare, shouldRetrieveBypassCache, shouldReturnGeneratedKeys, shouldStoreBypassCache, shouldUseWrapperPolicy, shouldValidateUpdateCallCacheUse, storeBypassCache
- 
Field Details- 
containerPolicyUsed for collection and stream support.
- 
startWithExpressionUsed for Oracle HierarchicalQuery support
- 
connectByExpression
- 
orderSiblingsByExpressions
- 
direction
 
- 
- 
Constructor Details- 
ReadAllQuerypublic ReadAllQuery()PUBLIC: Return a new read all query. A reference class must be specified before execution. It is better to provide the class and expression builder on construction to ensure a single expression builder is used. If no selection criteria is specified this will read all objects of the class from the database.
- 
ReadAllQueryPUBLIC: Return a new read all query. It is better to provide the class and expression builder on construction to ensure a single expression builder is used. If no selection criteria is specified this will read all objects of the class from the database.
- 
ReadAllQueryPUBLIC: Return a new read all query for the class and the selection criteria.
- 
ReadAllQueryPUBLIC: Return a new read all query for the class. The expression builder must be used for all associated expressions used with the query.
- 
ReadAllQueryPUBLIC: Return a new read all query. The call represents a database interaction such as SQL, Stored Procedure.
- 
ReadAllQueryPUBLIC: Return a query by example query to find all objects matching the attributes of the example object.
- 
ReadAllQueryPUBLIC: The expression builder should be provide on creation to ensure only one is used.
- 
ReadAllQueryPUBLIC: Create a read all query with the database call.
 
- 
- 
Method Details- 
addAscendingOrderingPUBLIC: Order the query results by the object's attribute or query key name.
- 
cacheResultINTERNAL:This method is called by the object builder when building an original. It will cause the original to be cached in the query results if the query is set to do so. - Specified by:
- cacheResultin class- ReadQuery
 
- 
checkEarlyReturnLocalINTERNAL: The cache check is done before the prepare as a hit will not require the work to be done.- Specified by:
- checkEarlyReturnLocalin class- ObjectLevelReadQuery
 
- 
checkCustomQueryFlagINTERNAL: Check and return custom query flag. Custom query flag value is initialized when stored value isnull. Called fromObjectLevelReadQuery.checkForCustomQuery(AbstractSession, AbstractRecord)to retrieve custom query flag.- Specified by:
- checkCustomQueryFlagin class- ObjectLevelReadQuery
- Parameters:
- session- Current session (not used).
- translationRow- Database record (not used).
- Returns:
- Current custom query flag. Value will never be null.
 
- 
getReadQueryINTERNAL: Get custom all read query from query manager. Called fromObjectLevelReadQuery.checkForCustomQuery(AbstractSession, AbstractRecord)to retrieve custom read query.- Specified by:
- getReadQueryin class- ObjectLevelReadQuery
- Returns:
- Custom all read query from query manager.
 
- 
cloneINTERNAL: Creates and returns a copy of this query.- Overrides:
- clonein class- ObjectLevelReadQuery
- Returns:
- A clone of this instance.
 
- 
conformResultprotected Object conformResult(Object result, UnitOfWorkImpl unitOfWork, AbstractRecord arguments, boolean buildDirectlyFromRows) INTERNAL: Conform the result if specified.
- 
executeINTERNAL: Execute the query. If there are cached results return those. This must override the super to support result caching.- Overrides:
- executein class- ObjectLevelReadQuery
- Parameters:
- session- - the session in which the receiver will be executed.
- Returns:
- An object or vector, the result of executing the query.
- Throws:
- DatabaseException- - an error has occurred on the database
 
- 
executeObjectLevelReadQueryINTERNAL: Execute the query. Get the rows and build the object from the rows.- Specified by:
- executeObjectLevelReadQueryin class- ObjectLevelReadQuery
- Returns:
- java.lang.Object collection of objects resulting from execution of query.
- Throws:
- DatabaseException- - an error has occurred on the database
 
- 
executeObjectLevelReadQueryFromResultSetINTERNAL: Execute the query building the objects directly from the database result-set.- Specified by:
- executeObjectLevelReadQueryFromResultSetin class- ObjectLevelReadQuery
- Returns:
- an ArrayList of the resulting objects.
- Throws:
- DatabaseException- - an error has occurred on the database
 
- 
extractRemoteResultINTERNAL: Extract the correct query result from the transporter.- Overrides:
- extractRemoteResultin class- DatabaseQuery
 
- 
getContainerPolicyINTERNAL: Return the query's container policy.
- 
getDefaultRedirectorINTERNAL: Returns the specific default redirector for this query type. There are numerous default query redirectors. See ClassDescriptor for their types.- Overrides:
- getDefaultRedirectorin class- DatabaseQuery
 
- 
getStartWithExpressionPUBLIC:- Returns:
- Expression - the start with expression used to generated the hierarchical query clause in Oracle
 
- 
getConnectByExpressionPUBLIC:- Returns:
- Expression - the connect by expression used to generate the hierarchical query caluse in Oracle
 
- 
getOrderSiblingsByExpressionsPUBLIC:- Returns:
- List<Expression> - the ordering expressions used to generate the hierarchical query clause in Oracle
 
- 
getDirectionPUBLIC:- Returns:
- Direction - the direction in which the hierarchy is traversed
 
- 
hasHierarchicalExpressionspublic boolean hasHierarchicalExpressions()INTERNAL: Verify that we have hierarchical query expressions
- 
isDefaultPropertiesQuerypublic 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 JPQL or selection criteria.- Overrides:
- isDefaultPropertiesQueryin class- ObjectLevelReadQuery
 
- 
equalsINTERNAL: Return if the query is equal to the other. This is used to allow dynamic expression query SQL to be cached.- Overrides:
- equalsin class- ObjectLevelReadQuery
 
- 
isReadAllQuerypublic boolean isReadAllQuery()PUBLIC: Return if this is a read all query.- Overrides:
- isReadAllQueryin class- DatabaseQuery
 
- 
prepareINTERNAL: Prepare the receiver for execution in a session.- Overrides:
- preparein class- ObjectLevelReadQuery
- Throws:
- QueryException
 
- 
prepareFromQueryINTERNAL: 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.- Overrides:
- prepareFromQueryin class- ObjectLevelReadQuery
 
- 
prepareCustomQueryINTERNAL: Set the properties needed to be cascaded into the custom query.- Overrides:
- prepareCustomQueryin class- ObjectBuildingQuery
 
- 
prepareForExecutionINTERNAL: Prepare the receiver for execution in a session.- Overrides:
- prepareForExecutionin class- ReadQuery
- Throws:
- QueryException
 
- 
prepareSelectAllRowsprotected void prepareSelectAllRows()INTERNAL: Prepare the mechanism.
- 
registerResultInUnitOfWorkpublic Object registerResultInUnitOfWork(Object result, UnitOfWorkImpl unitOfWork, AbstractRecord arguments, boolean buildDirectlyFromRows) INTERNAL: All objects queried via a UnitOfWork get registered here. If the query went to the database.Involves registering the query result individually and in totality, and hence refreshing / conforming is done here. - Specified by:
- registerResultInUnitOfWorkin class- ObjectLevelReadQuery
- Parameters:
- 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 conforming
- buildDirectlyFromRows- If in transaction must construct a registered result from raw database rows.
- Returns:
- the final (conformed, refreshed, wrapped) UnitOfWork query result
 
- 
registerResultSetInUnitOfWorkpublic Object registerResultSetInUnitOfWork(ResultSet resultSet, Vector fields, DatabaseField[] fieldsArray, UnitOfWorkImpl unitOfWork, AbstractRecord arguments) throws SQLException INTERNAL: Version of the previous method for ResultSet optimization.- Returns:
- the final (conformed, refreshed, wrapped) UnitOfWork query result
- Throws:
- SQLException
 
- 
remoteExecuteINTERNAL: Execute the query through remote session.- Overrides:
- remoteExecutein class- DatabaseQuery
 
- 
replaceValueHoldersInINTERNAL: replace the value holders in the specified result object(s)- Overrides:
- replaceValueHoldersInin class- DatabaseQuery
 
- 
setContainerPolicyPUBLIC: Set the container policy. Used to support different containers (e.g. Collections, Maps).
- 
setHierarchicalQueryClausepublic void setHierarchicalQueryClause(Expression startWith, Expression connectBy, List<Expression> orderSiblingsExpressions) PUBLIC: Set the Hierarchical Query Clause for the queryExample: Expression startWith = builder.get("id").equal(Integer.valueOf(100)); //can be any expression which identifies a set of employees Expression connectBy = builder.get("managedEmployees"); //indicated the relationship that the hierarchy is based on, must be self-referential Vector orderBy = new Vector(); orderBy.addElement(builder.get("startDate")); readAllQuery.setHierarchicalQueryClause(startWith, connectBy, orderBy); This query would generate SQL like this: SELECT * FROM EMPLOYEE START WITH ID=100 CONNECT BY PRIOR ID = MANAGER_ID ORDER SIBLINGS BY START_DATE - Parameters:
- startWith- Describes the START WITH clause of the query - null if not needed
- connectBy- This should be a query key expression which indicates an attribute who's mapping describes the hierarchy
- orderSiblingsExpressions- Contains expressions which indicate fields to be included in the ORDER SIBLINGS BY clause - null if not required
 
- 
setHierarchicalQueryClausepublic void setHierarchicalQueryClause(Expression startWith, Expression connectBy, List<Expression> orderSiblingsExpressions, ReadAllQuery.Direction direction) PUBLIC: Set the Hierarchical Query Clause for the query, specifying the hierarchy traversal directionExample: Expression startWith = builder.get("id").equal(Integer.valueOf(100)); //can be any expression which identifies a set of employees 
 Expression connectBy = builder.get("managedEmployees"); //indicated the relationship that the hierarchy is based on, must be self-referential
 Vector orderBy = new Vector();
 orderBy.addElement(builder.get("startDate"));
 readAllQuery.setHierarchicalQueryClause(startWith, connectBy, orderBy, Direction.CHILD_TO_PARENT);This query would generate SQL like this: SELECT * FROM EMPLOYEE START WITH ID=100 CONNECT BY ID = PRIOR MANAGER_ID ORDER SIBLINGS BY START_DATE - Parameters:
- startWith- Describes the START WITH clause of the query - null if not needed
- connectBy- This should be a query key expression which indicates an attribute who's mapping describes the hierarchy
- orderSiblingsExpressions- Contains expressions which indicate fields to be included in the ORDER SIBLINGS BY clause - null if not required
- direction- The direction in which the hierarchy is traversed; if not specified, CHILD_TO_PARENT is used for OneToOne relationships and PARENT_TO_CHILD is used for collections
 
- 
useCollectionClassPUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.jdk1.2.x: The container class must implement (directly or indirectly) the Collection interface. jdk1.1.x: The container class must be a subclass of Vector. 
- 
useCursoredStreampublic void useCursoredStream()PUBLIC: Use a CursoredStream as the result collection. The initial read size is 10 and page size is 5.
- 
useCursoredStreampublic void useCursoredStream(int initialReadSize, int pageSize) PUBLIC: Use a CursoredStream as the result collection.- Parameters:
- initialReadSize- the initial number of objects to read
- pageSize- the number of objects to read when more objects are needed from the database
 
- 
useCursoredStreamPUBLIC: Use a CursoredStream as the result collection.- Parameters:
- initialReadSize- the initial number of objects to read
- pageSize- the number of objects to read when more objects are needed from the database
- sizeQuery- a query that will return the size of the result set; this must be set if an expression is not used (i.e. custom SQL)
 
- 
useMapClassPUBLIC: Configure the query to use an instance of the specified container class to hold the result objects. The key used to index the value in the Map is the value returned by a call to the specified zero-argument method. The method must be implemented by the class (or a superclass) of the value to be inserted into the Map.jdk1.2.x: The container class must implement (directly or indirectly) the Map interface. jdk1.1.x: The container class must be a subclass of Hashtable. The referenceClass must set before calling this method. 
- 
useScrollableCursorpublic void useScrollableCursor()PUBLIC: Use a ScrollableCursor as the result collection.
- 
useScrollableCursorpublic void useScrollableCursor(int pageSize) PUBLIC: Use a ScrollableCursor as the result collection.- Parameters:
- pageSize- the number of elements to be read into a the cursor when more elements are needed from the database.
 
- 
useScrollableCursorPUBLIC: Use a ScrollableCursor as the result collection.- Parameters:
- policy- the scrollable cursor policy allows for additional result set options. Example:- ScrollableCursorPolicy policy = new ScrollableCursorPolicy() - policy.setResultSetType(ScrollableCursorPolicy.TYPE_SCROLL_INSENSITIVE); - query.useScrollableCursor(policy); 
 
- 
supportsResultSetAccessOptimizationOnPreparepublic boolean supportsResultSetAccessOptimizationOnPrepare()INTERNAL: Indicates whether the query can use ResultSet optimization. The method is called when the query is prepared, so it should refer only to the attributes that cannot be altered without re-preparing the query. If the query is a clone and the original has been already prepared this method will be called to set a (transient and therefore set to null) usesResultSetOptimization attribute.- Overrides:
- supportsResultSetAccessOptimizationOnPreparein class- ObjectLevelReadQuery
 
- 
supportsResultSetAccessOptimizationOnExecutepublic boolean supportsResultSetAccessOptimizationOnExecute()INTERNAL: Indicates whether the query can use ResultSet optimization. Note that the session must be already set. The method is called when the query is executed, so it should refer only to the attributes that can be altered without re-preparing the query.- Overrides:
- supportsResultSetAccessOptimizationOnExecutein class- ObjectLevelReadQuery
 
 
-