org.apache.cayenne.query
Class PrefetchSelectQuery

java.lang.Object
  extended by org.apache.cayenne.query.AbstractQuery
      extended by org.apache.cayenne.query.QualifiedQuery
          extended by org.apache.cayenne.query.SelectQuery
              extended by org.apache.cayenne.query.PrefetchSelectQuery
All Implemented Interfaces:
Serializable, ParameterizedQuery, Query, XMLSerializable

public class PrefetchSelectQuery
extends SelectQuery

A SelectQuery to perform a prefetch based on another query. Used internally by Cayenne and is normally never used directly.

See Also:
Serialized Form

Field Summary
protected  ObjRelationship lastPrefetchHint
          Stores the last ObjRelationship in the prefetch path.
protected  SelectQuery parentQuery
           
protected  String prefetchPath
          The relationship path from root objects to the objects being prefetched.
protected  Collection<String> resultPaths
           
 
Fields inherited from class org.apache.cayenne.query.SelectQuery
distinct, DISTINCT_DEFAULT, DISTINCT_PROPERTY, orderings
 
Fields inherited from class org.apache.cayenne.query.QualifiedQuery
qualifier
 
Fields inherited from class org.apache.cayenne.query.AbstractQuery
name, root
 
Constructor Summary
PrefetchSelectQuery(SelectQuery parentQuery, String prefetchPath, ObjRelationship lastPrefetchHint)
          Creates a new disjoint prefetch select query.
 
Method Summary
 void addResultPath(String path)
          Configures an "extra" path that will resolve to an extra column (or columns) in the result set.
 ObjRelationship getLastPrefetchHint()
          Retunrs last incoming ObjRelationship in the prefetch relationship chain.
 SelectQuery getParentQuery()
           
 String getPrefetchPath()
          Returns the prefetchPath.
 Collection<String> getResultPaths()
          Returns extra result paths.
 void removeResultPath(String path)
          Removes an extra result path.
 void setLastPrefetchHint(ObjRelationship relationship)
           
 void setParentQuery(SelectQuery parentQuery)
           
 void setPrefetchPath(String prefetchPath)
          Sets the prefetchPath.
 
Methods inherited from class org.apache.cayenne.query.SelectQuery
addOrdering, addOrdering, addOrdering, addOrdering, addOrderings, addPrefetch, aliasPathSplits, clearOrderings, clearPrefetches, createQuery, createSQLAction, encodeAsXML, getCacheGroups, getCachePolicy, getCacheStrategy, getFetchLimit, getFetchOffset, getMetaData, getOrderings, getPageSize, getPrefetchTree, getStatementFetchSize, initWithProperties, isDistinct, isFetchingDataRows, isRefreshingObjects, isResolvingInherited, queryWithParameters, queryWithParameters, removeOrdering, removePrefetch, route, setCacheGroups, setCachePolicy, setCacheStrategy, setDistinct, setFetchingDataRows, setFetchLimit, setFetchOffset, setPageSize, setPrefetchTree, setRefreshingObjects, setResolvingInherited, setStatementFetchSize
 
Methods inherited from class org.apache.cayenne.query.QualifiedQuery
andQualifier, getQualifier, orQualifier, setQualifier
 
Methods inherited from class org.apache.cayenne.query.AbstractQuery
getName, getRoot, setName, setRoot, toString
 
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
getName
 

Field Detail

parentQuery

protected SelectQuery parentQuery

prefetchPath

protected String prefetchPath
The relationship path from root objects to the objects being prefetched.


lastPrefetchHint

protected ObjRelationship lastPrefetchHint
Stores the last ObjRelationship in the prefetch path.


resultPaths

protected Collection<String> resultPaths
Constructor Detail

PrefetchSelectQuery

public PrefetchSelectQuery(SelectQuery parentQuery,
                           String prefetchPath,
                           ObjRelationship lastPrefetchHint)
Creates a new disjoint prefetch select query.

Since:
1.2
Method Detail

getPrefetchPath

public String getPrefetchPath()
Returns the prefetchPath.

Returns:
String

setPrefetchPath

public void setPrefetchPath(String prefetchPath)
Sets the prefetchPath.

Parameters:
prefetchPath - The prefetchPath to set

getParentQuery

public SelectQuery getParentQuery()
Since:
1.1

setParentQuery

public void setParentQuery(SelectQuery parentQuery)
Since:
1.1

getLastPrefetchHint

public ObjRelationship getLastPrefetchHint()
Retunrs last incoming ObjRelationship in the prefetch relationship chain.

Since:
1.1

setLastPrefetchHint

public void setLastPrefetchHint(ObjRelationship relationship)
Since:
1.1

addResultPath

public void addResultPath(String path)
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

public void removeResultPath(String path)
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 purspose of this method "db:ARTIST_NAME" and "obj:artistName" are not the same, though both will resolve to the same column name.


getResultPaths

public Collection<String> getResultPaths()
Returns extra result paths.

Since:
1.2


Copyright © 2001-2011 Apache Cayenne. All Rights Reserved.