Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.query
Class PrefetchSelectQuery

    java.lang.Object
      org.apache.cayenne.query.AbstractQuery
          org.apache.cayenne.query.QualifiedQuery
              org.apache.cayenne.query.SelectQuery
                  org.apache.cayenne.query.PrefetchSelectQuery

All Implemented Interfaces:
  java.io.Serializable, GenericSelectQuery, 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.

Author:
  Craig Miskell, Andrei Adamchik
See Also:
  Serialized Form

Field Summary
`protected ObjRelationship` | `lastPrefetchHint` Stores the last ObjRelationship in the prefetch path.
`protected SelectQuery` | `parentQuery`
`protected java.lang.String` | `prefetchPath` The relationship path from root objects to the objects being prefetched.
`protected java.util.Collection` | `resultPaths`

Fields inherited from class org.apache.cayenne.query.SelectQuery
`customDbAttributes, distinct, DISTINCT_DEFAULT, DISTINCT_PROPERTY, orderings, parentObjEntityName, parentQualifier`

Fields inherited from class org.apache.cayenne.query.QualifiedQuery
`qualifier`

Fields inherited from class org.apache.cayenne.query.AbstractQuery
`name, root`

Fields inherited from interface org.apache.cayenne.query.GenericSelectQuery
`CACHE_POLICY_DEFAULT, CACHE_POLICY_PROPERTY, FETCH_LIMIT_DEFAULT, FETCH_LIMIT_PROPERTY, FETCHING_DATA_ROWS_DEFAULT, FETCHING_DATA_ROWS_PROPERTY, LOCAL_CACHE, NO_CACHE, PAGE_SIZE_DEFAULT, PAGE_SIZE_PROPERTY, REFRESHING_OBJECTS_DEFAULT, REFRESHING_OBJECTS_PROPERTY, RESOLVING_INHERITED_DEFAULT, RESOLVING_INHERITED_PROPERTY, SHARED_CACHE`

Constructor Summary
`PrefetchSelectQuery(EntityResolver resolver, SelectQuery parentQuery, java.lang.String prefetch)` Deprecated. since 1.2 - passing EntityResolver in constructor is no longer needed, as prefetch query configuration alogrithm is moved out of this class. In fact this constructor will not correctly configure query to handle flattened prefetches.
`PrefetchSelectQuery(SelectQuery parentQuery, 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()`
`java.lang.String` | `getPrefetchPath()` Returns the prefetchPath.
`java.util.Collection` | `getResultPaths()` Returns extra result paths.
`void` | `removeResultPath(java.lang.String path)` Removes an extra result path.
`void` | `setLastPrefetchHint(ObjRelationship relationship)`
`void` | `setParentQuery(SelectQuery parentQuery)`
`void` | `setPrefetchPath(java.lang.String prefetchPath)` Sets the prefetchPath.

Methods inherited from class org.apache.cayenne.query.SelectQuery
`addCustomDbAttribute, addCustomDbAttributes, addOrdering, addOrdering, addOrdering, addOrderings, addPrefetch, addPrefetches, andParentQualifier, clearOrderings, clearPrefetches, createQuery, createSQLAction, encodeAsXML, getCachePolicy, getCustomDbAttributes, getFetchLimit, getMetaData, getOrderings, getPageSize, getParentObjEntityName, getParentQualifier, getPrefetches, getPrefetchTree, initWithProperties, isDistinct, isFetchingCustomAttributes, isFetchingDataRows, isQualifiedOnParent, isRefreshingObjects, isResolvingInherited, orParentQualifier, queryWithParameters, queryWithParameters, removeOrdering, removePrefetch, route, setCachePolicy, setDistinct, setFetchingDataRows, setFetchLimit, setPageSize, setParentObjEntityName, setParentQualifier, setPrefetchTree, setRefreshingObjects, setResolvingInherited`

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, getRoot, setName, setRoot`

Methods inherited from interface org.apache.cayenne.query.Query
`getName, getRoot, setName, setRoot`

Field Detail

### parentQuery

    protected SelectQuery parentQuery

### 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 resultPaths

Constructor Detail

### PrefetchSelectQuery

    public PrefetchSelectQuery(EntityResolver resolver,
                               SelectQuery parentQuery,
                               java.lang.String prefetch)

  Deprecated. since 1.2 - passing EntityResolver in constructor is no longer needed, as prefetch query configuration alogrithm is moved out of this class. In fact this constructor will not correctly configure query to handle flattened prefetches.

  Creates a prefetch query based on parent query.

  Since:
    1.1

### PrefetchSelectQuery

    public PrefetchSelectQuery(SelectQuery parentQuery,
                               java.lang.String prefetchPath,
                               ObjRelationship lastPrefetchHint)

  Creates a new disjoint prefetch select query.

  Since:
    1.2

Method Detail

### getPrefetchPath

    public java.lang.String getPrefetchPath()

  Returns the prefetchPath.

  Returns:
    String

### setPrefetchPath

    public void setPrefetchPath(java.lang.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(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 getResultPaths()

  Returns extra result paths.

  Since:
    1.2

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2006 Apache.org All Rights Reserved.