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>
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
as part of the deprecation of theSelectQuery
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected ObjRelationship
Stores the last ObjRelationship in the prefetch path.protected String
The relationship path from root objects to the objects being prefetched.protected Collection
<String> Fields inherited from class org.apache.cayenne.query.ObjectSelect
metaData
Fields inherited from class org.apache.cayenne.query.FluentSelect
dbEntityName, entityName, entityType, having, orderings, where
Fields inherited from class org.apache.cayenne.query.AbstractQuery
root
Fields inherited from class org.apache.cayenne.query.CacheableQuery
logger
-
Constructor Summary
ConstructorDescriptionPrefetchSelectQuery
(String prefetchPath, ObjRelationship lastPrefetchHint) Creates a new disjoint prefetch select query. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addResultPath
(String 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.void
removeResultPath
(String path) Removes an extra result path.protected void
routePrefetches
(QueryRouter router, EntityResolver resolver) void
setLastPrefetchHint
(ObjRelationship relationship) void
setPrefetchPath
(String prefetchPath) Sets the prefetchPath.void
setPrefetchTree
(PrefetchTreeNode prefetch) Clean set of the prefetch tree without any merge with existing nodes.Methods inherited from class org.apache.cayenne.query.ObjectSelect
and, and, avg, avg, cacheGroup, cacheStrategy, cacheStrategy, column, columnQuery, columnQuery, columns, count, count, createQuery, dataRowQuery, dataRowQuery, dbEntityName, dbQuery, dbQuery, distinct, entityName, entityType, fetchDataRows, getBaseMetaData, getMetaData, having, having, isFetchingDataRows, limit, localCache, localCache, max, max, min, min, offset, or, or, orderBy, orderBy, orderBy, orderBy, pageSize, prefetch, prefetch, query, query, query, query, queryTimeout, selectCount, selectFirst, sharedCache, sharedCache, statementFetchSize, sum, sum, where, where
Methods inherited from class org.apache.cayenne.query.FluentSelect
batchIterator, createSQLAction, getColumns, getDbEntityName, getEntityName, getEntityType, getHaving, getLimit, getOffset, getOrderings, getPageSize, getPrefetches, getQueryTimeout, getStatementFetchSize, getWhere, initWithProperties, isDistinct, iterate, iterator, resolveRoot, route, select, selectOne
Methods inherited from class org.apache.cayenne.query.AbstractQuery
getRoot, setRoot, toString
Methods inherited from class org.apache.cayenne.query.CacheableQuery
getCacheGroup, getCacheStrategy, setCacheGroup, setCacheStrategy, useLocalCache, useLocalCache, useSharedCache, useSharedCache
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.cayenne.query.Query
createSQLAction, route
-
Field Details
-
prefetchPath
The relationship path from root objects to the objects being prefetched. -
lastPrefetchHint
Stores the last ObjRelationship in the prefetch path. -
resultPaths
-
-
Constructor Details
-
PrefetchSelectQuery
Creates a new disjoint prefetch select query.- Since:
- 3.1
-
-
Method Details
-
routePrefetches
- Overrides:
routePrefetches
in classFluentSelect<T>
-
getPrefetchPath
Returns the prefetchPath. -
setPrefetchPath
Sets the prefetchPath.- Parameters:
prefetchPath
- The prefetchPath to set
-
setPrefetchTree
Clean set of the prefetch tree without any merge with existing nodes.- Parameters:
prefetch
- prefetch tree- Since:
- 4.2
-
getLastPrefetchHint
Returns last incoming ObjRelationship in the prefetch relationship chain.- Since:
- 1.1
-
setLastPrefetchHint
- Since:
- 1.1
-
addResultPath
Configures 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
-
removeResultPath
Removes 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. -
getResultPaths
Returns extra result paths.- Since:
- 1.2
-