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:
java.io.Serializable, ConfigurationNode, 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
          Deprecated. since 3.1 unused
protected  java.lang.String prefetchPath
          The relationship path from root objects to the objects being prefetched.
protected  java.util.Collection<java.lang.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
dataMap, name, root
 
Constructor Summary
PrefetchSelectQuery(SelectQuery parentQuery, java.lang.String prefetchPath, ObjRelationship lastPrefetchHint)
          Deprecated. Since 3.1 use another constructor without parentQuery parameter instead.
PrefetchSelectQuery(java.lang.String prefetchPath, ObjRelationship lastPrefetchHint)
          Creates a new disjoint prefetch select query.
 
Method Summary
 void addResultPath(java.lang.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()
          Deprecated. since 3.1
 java.lang.String getPrefetchPath()
          Returns the prefetchPath.
 java.util.Collection<java.lang.String> getResultPaths()
          Returns extra result paths.
 void removeResultPath(java.lang.String path)
          Removes an extra result path.
 void setLastPrefetchHint(ObjRelationship relationship)
           
 void setParentQuery(SelectQuery parentQuery)
          Deprecated. since 3.1
 void setPrefetchPath(java.lang.String prefetchPath)
          Sets the prefetchPath.
 
Methods inherited from class org.apache.cayenne.query.SelectQuery
addOrdering, addOrdering, addOrderings, addPrefetch, aliasPathSplits, clearOrderings, clearPrefetches, createQuery, createSQLAction, encodeAsXML, getCacheGroups, getCacheStrategy, getFetchLimit, getFetchOffset, getMetaData, getOrderings, getPageSize, getPrefetchTree, getStatementFetchSize, initWithProperties, isDistinct, isFetchingDataRows, queryWithParameters, queryWithParameters, removeOrdering, removePrefetch, route, setCacheGroups, setCacheStrategy, setDistinct, setFetchingDataRows, setFetchLimit, setFetchOffset, setPageSize, setPrefetchTree, setStatementFetchSize
 
Methods inherited from class org.apache.cayenne.query.QualifiedQuery
andQualifier, getQualifier, orQualifier, setQualifier
 
Methods inherited from class org.apache.cayenne.query.AbstractQuery
acceptVisitor, getDataMap, getName, getRoot, setDataMap, 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
getDataMap, getName
 
Methods inherited from interface org.apache.cayenne.configuration.ConfigurationNode
acceptVisitor
 

Field Detail

parentQuery

@Deprecated
protected SelectQuery parentQuery
Deprecated. since 3.1 unused

prefetchPath

protected java.lang.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 java.util.Collection<java.lang.String> resultPaths
Constructor Detail

PrefetchSelectQuery

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

Since:
3.1

PrefetchSelectQuery

@Deprecated
public PrefetchSelectQuery(SelectQuery parentQuery,
                                      java.lang.String prefetchPath,
                                      ObjRelationship lastPrefetchHint)
Deprecated. Since 3.1 use another constructor without parentQuery parameter instead.

Creates a new disjoint prefetch select query.

Since:
1.2
Method Detail

getPrefetchPath

public java.lang.String getPrefetchPath()
Returns the prefetchPath.


setPrefetchPath

public void setPrefetchPath(java.lang.String prefetchPath)
Sets the prefetchPath.

Parameters:
prefetchPath - The prefetchPath to set

getParentQuery

@Deprecated
public SelectQuery getParentQuery()
Deprecated. since 3.1

Since:
1.1

setParentQuery

@Deprecated
public void setParentQuery(SelectQuery parentQuery)
Deprecated. since 3.1

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(java.lang.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(java.lang.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 java.util.Collection<java.lang.String> getResultPaths()
Returns extra result paths.

Since:
1.2


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