Package org.apache.cayenne.query
Class PrefetchSelectQuery<T>
java.lang.Object
org.apache.cayenne.query.CacheableQuery
org.apache.cayenne.query.AbstractQuery
org.apache.cayenne.query.FluentSelect<T,ObjectSelect<T>>
 
org.apache.cayenne.query.ObjectSelect<T>
org.apache.cayenne.query.PrefetchSelectQuery<T>
- All Implemented Interfaces:
- Serializable,- ParameterizedQuery,- Query,- Select<T>
A SelectQuery to perform a prefetch based on another query. Used internally by Cayenne
 and is normally never used directly.
- Since:
- 4.2 this query extends ObjectSelect
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected ObjRelationshipStores the last ObjRelationship in the prefetch path.protected CayennePathThe relationship path from root objects to the objects being prefetched.protected Collection<ASTPath>Fields inherited from class org.apache.cayenne.query.FluentSelectdbEntityName, distinct, entityName, entityType, having, havingExpressionIsActive, metaData, orderings, whereFields inherited from class org.apache.cayenne.query.AbstractQueryrootFields inherited from class org.apache.cayenne.query.CacheableQuerylogger
- 
Constructor SummaryConstructorsConstructorDescriptionPrefetchSelectQuery(CayennePath prefetchPath, ObjRelationship lastPrefetchHint) Creates a new disjoint prefetch select query.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddResultPath(String path) Configures an "extra" path that will resolve to an extra column (or columns) in the result set.voidaddResultPath(Expression path) Configures an "extra" path that will resolve to an extra column (or columns) in the result set.Returns last incoming ObjRelationship in the prefetch relationship chain.Returns the prefetchPath.Returns extra result paths.voidremoveResultPath(String path) Removes an extra result path.voidremoveResultPath(CayennePath path) Removes an extra result path.protected voidroutePrefetches(QueryRouter router, EntityResolver resolver) voidsetLastPrefetchHint(ObjRelationship relationship) voidsetPrefetchPath(String prefetchPath) Sets the prefetchPath.voidsetPrefetchPath(CayennePath prefetchPath) Sets the prefetchPath.voidsetPrefetchTree(PrefetchTreeNode prefetch) Clean set of the prefetch tree without any merge with existing nodes.Methods inherited from class org.apache.cayenne.query.ObjectSelectaggregate, avg, column, columnQuery, columnQuery, columns, count, count, createMetadata, createQuery, dataRowQuery, dataRowQuery, dbQuery, dbQuery, distinct, fetchDataRows, getBaseMetaData, getMetaData, having, having, max, max, min, min, query, query, query, query, selectCount, selectFirst, sumMethods inherited from class org.apache.cayenne.query.FluentSelectand, and, batchIterator, cacheGroup, cacheStrategy, cacheStrategy, castSelf, createSQLAction, dbEntityName, entityName, entityType, getActiveExpression, getColumns, getDbEntityName, getEntityName, getEntityType, getHaving, getLimit, getOffset, getOrderings, getPageSize, getPrefetches, getQueryTimeout, getStatementFetchSize, getWhere, initWithProperties, isDistinct, isFetchingDataRows, iterate, iterator, joinExpression, limit, localCache, localCache, offset, or, or, orderBy, orderBy, orderBy, orderBy, pageSize, prefetch, prefetch, queryTimeout, resolveRoot, route, select, selectOne, setActiveExpression, sharedCache, sharedCache, statementFetchSize, where, whereMethods inherited from class org.apache.cayenne.query.AbstractQuerygetRoot, setRoot, toStringMethods inherited from class org.apache.cayenne.query.CacheableQuerygetCacheGroup, getCacheStrategy, setCacheGroup, setCacheStrategy, useLocalCache, useLocalCache, useSharedCache, useSharedCacheMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.cayenne.query.QuerycreateSQLAction, route
- 
Field Details- 
prefetchPathThe relationship path from root objects to the objects being prefetched.
- 
lastPrefetchHintStores the last ObjRelationship in the prefetch path.
- 
resultPaths
 
- 
- 
Constructor Details- 
PrefetchSelectQueryCreates a new disjoint prefetch select query.- Since:
- 3.1
 
 
- 
- 
Method Details- 
routePrefetches- Overrides:
- routePrefetchesin class- FluentSelect<T,- ObjectSelect<T>> 
 
- 
getPrefetchPathReturns the prefetchPath.- Since:
- 5.0 returns CayennePathinstead of a plainString
 
- 
setPrefetchPathSets the prefetchPath.- Parameters:
- prefetchPath- The prefetchPath to set
- See Also:
 
- 
setPrefetchPathSets the prefetchPath.- Parameters:
- prefetchPath- The prefetchPath to set
- Since:
- 5.0
 
- 
setPrefetchTreeClean set of the prefetch tree without any merge with existing nodes.- Parameters:
- prefetch- prefetch tree
- Since:
- 4.2
 
- 
getLastPrefetchHintReturns last incoming ObjRelationship in the prefetch relationship chain.- Since:
- 1.1
 
- 
setLastPrefetchHint- Since:
- 1.1
 
- 
addResultPathConfigures an "extra" path that will resolve to an extra column (or columns) in the result set.- Parameters:
- path- A valid path expression. E.g. "abc" or "db:ABC" or "abc.xyz".
- Since:
- 1.2
 
- 
addResultPathConfigures an "extra" path that will resolve to an extra column (or columns) in the result set.- Parameters:
- path- a path expression
- Since:
- 5.0
 
- 
removeResultPathRemoves an extra result path. Note that this method doesn't check for expression invariants, as it doesn't have a proper context to do so. E.g. for the purpose of this method "db:ARTIST_NAME" and "obj:artistName" are not the same, though both will resolve to the same column name.- See Also:
 
- 
removeResultPathRemoves an extra result path. Note that this method doesn't check for expression invariants, as it doesn't have a proper context to do so. E.g. for the purpose of this method "db:ARTIST_NAME" and "obj:artistName" are not the same, though both will resolve to the same column name.- Since:
- 5.0
 
- 
getResultPathsReturns extra result paths.- Since:
- 1.2, 5.0 returns collection of CayennePath
 
 
-