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

## org.apache.cayenne.query
Interface QueryMetadata

    public interface QueryMetadata

Provides a common interface for accessing query metadata.

Since:
  1.2
Author:
  Andrus Adamchik

Field Summary
`static String` | `CACHE_GROUPS_PROPERTY`
`static String` | `CACHE_POLICY_DEFAULT` Deprecated. since 3.0 use `QueryCacheStrategy` enum.
`static String` | `CACHE_POLICY_PROPERTY` Deprecated. since 3.0 use "cayenne.GenericSelectQuery.cacheStrategy"
`static String` | `CACHE_STRATEGY_PROPERTY`
`static int` | `FETCH_LIMIT_DEFAULT` Defines default query fetch limit, which is zero, meaning that all matching rows should be fetched.
`static String` | `FETCH_LIMIT_PROPERTY` Defines the name of the property for the query `fetch limit`.
`static boolean` | `FETCHING_DATA_ROWS_DEFAULT`
`static String` | `FETCHING_DATA_ROWS_PROPERTY`
`static String` | `LOCAL_CACHE` Deprecated. since 3.0 use `QueryCacheStrategy` enum.
`static String` | `LOCAL_CACHE_REFRESH` Deprecated. since 3.0 use `QueryCacheStrategy` enum.
`static String` | `NO_CACHE` Deprecated. since 3.0 use `QueryCacheStrategy` enum.
`static int` | `PAGE_SIZE_DEFAULT` Defines default query page size, which is zero for no pagination.
`static String` | `PAGE_SIZE_PROPERTY` Defines the name of the property for the query `page size`.
`static boolean` | `REFRESHING_OBJECTS_DEFAULT`
`static String` | `REFRESHING_OBJECTS_PROPERTY`
`static boolean` | `RESOLVING_INHERITED_DEFAULT`
`static String` | `RESOLVING_INHERITED_PROPERTY`
`static String` | `SHARED_CACHE` Deprecated. since 3.0 use `QueryCacheStrategy` enum.
`static String` | `SHARED_CACHE_REFRESH` Deprecated. since 3.0 use `QueryCacheStrategy` enum.

Method Summary
`String[]` | `getCacheGroups()` Returns an optional array of cache "groups".
`String` | `getCacheKey()` Returns a String that uniquely identifies this query for the purposes of result caching.
`String` | `getCachePolicy()` Deprecated. since 3.0 `getCacheStrategy()` replaces this method.
`QueryCacheStrategy` | `getCacheStrategy()` Returns a caching strategy for this query.
`ClassDescriptor` | `getClassDescriptor()`
`DataMap` | `getDataMap()` Returns a DataMap associated with a query or null if no such DataMap exists.
`DbEntity` | `getDbEntity()` Returns a DbEntity associated with a query or null if no such entity exists.
`int` | `getFetchLimit()` Returns the limit on the maximum number of records that can be returned by this query.
`int` | `getFetchStartIndex()` Specifies a start of a range when fetching a subset of records.
`ObjEntity` | `getObjEntity()` Returns an ObjEntity associated with a query or null if no such entity exists.
`Query` | `getOrginatingQuery()` Returns a query that originated this query.
`int` | `getPageSize()` Returns query page size.
`Map<String,String>` | `getPathSplitAliases()` Returns a map of aliases vs.
`PrefetchTreeNode` | `getPrefetchTree()` Returns a root node of prefetch tree used by this query, or null of no prefetches are configured.
`Procedure` | `getProcedure()` Returns a Procedure associated with a query or null if no such procedure exists.
`SQLResultSetMapping` | `getResultSetMapping()` Returns a mapping of the result set data rows.
`boolean` | `isFetchingDataRows()` Returns `true` if this query should produce a list of data rows as opposed to DataObjects, `false` for DataObjects.
`boolean` | `isRefreshingObjects()` Deprecated. since 3.0. With introduction of the cache strategies this setting is redundant, although it is still being taken into account. It will be removed in the later versions of Cayenne.
`boolean` | `isResolvingInherited()` Returns true if objects fetched via this query should be fully resolved according to the inheritance hierarchy.

Field Detail

### NO_CACHE

    static final String NO_CACHE

  Deprecated. since 3.0 use `QueryCacheStrategy` enum.
  A cache policy that disables caching of query results.

  See Also:
    Constant Field Values

### LOCAL_CACHE

    static final String LOCAL_CACHE

  Deprecated. since 3.0 use `QueryCacheStrategy` enum.
  A cache policy ruling that query results shall be cached separately for each DataContext.

  See Also:
    Constant Field Values

### LOCAL_CACHE_REFRESH

    static final String LOCAL_CACHE_REFRESH

  Deprecated. since 3.0 use `QueryCacheStrategy` enum.
  Same as `LOCAL_CACHE`, only forcing any current cache expiration.

  See Also:
    Constant Field Values

### SHARED_CACHE

    static final String SHARED_CACHE

  Deprecated. since 3.0 use `QueryCacheStrategy` enum.
  A cache policy ruling that query results shall be stored in a shared cache accessible by all DataContexts.

  See Also:
    Constant Field Values

### SHARED_CACHE_REFRESH

    static final String SHARED_CACHE_REFRESH

  Deprecated. since 3.0 use `QueryCacheStrategy` enum.
  Same as `SHARED_CACHE`, only forcing any current cache expiration.

  See Also:
    Constant Field Values

### FETCH_LIMIT_PROPERTY

    static final String FETCH_LIMIT_PROPERTY

  Defines the name of the property for the query `fetch limit`.

  See Also:
    Constant Field Values

### FETCH_LIMIT_DEFAULT

    static final int FETCH_LIMIT_DEFAULT

  Defines default query fetch limit, which is zero, meaning that all matching rows should be fetched.

  See Also:
    Constant Field Values

### PAGE_SIZE_PROPERTY

    static final String PAGE_SIZE_PROPERTY

  Defines the name of the property for the query `page size`.

  See Also:
    Constant Field Values

### PAGE_SIZE_DEFAULT

    static final int PAGE_SIZE_DEFAULT

  Defines default query page size, which is zero for no pagination.

  See Also:
    Constant Field Values

### FETCHING_DATA_ROWS_PROPERTY

    static final String FETCHING_DATA_ROWS_PROPERTY

See Also:
  Constant Field Values

### FETCHING_DATA_ROWS_DEFAULT

    static final boolean FETCHING_DATA_ROWS_DEFAULT

See Also:
  Constant Field Values

### REFRESHING_OBJECTS_PROPERTY

    static final String REFRESHING_OBJECTS_PROPERTY

See Also:
  Constant Field Values

### REFRESHING_OBJECTS_DEFAULT

    static final boolean REFRESHING_OBJECTS_DEFAULT

See Also:
  Constant Field Values

### RESOLVING_INHERITED_PROPERTY

    static final String RESOLVING_INHERITED_PROPERTY

See Also:
  Constant Field Values

### RESOLVING_INHERITED_DEFAULT

    static final boolean RESOLVING_INHERITED_DEFAULT

See Also:
  Constant Field Values

### CACHE_POLICY_PROPERTY

    static final String CACHE_POLICY_PROPERTY

  Deprecated. since 3.0 use "cayenne.GenericSelectQuery.cacheStrategy"
  See Also:
    Constant Field Values

### CACHE_STRATEGY_PROPERTY

    static final String CACHE_STRATEGY_PROPERTY

Since:
  3.0
See Also:
  Constant Field Values

### CACHE_GROUPS_PROPERTY

    static final String CACHE_GROUPS_PROPERTY

Since:
  3.0
See Also:
  Constant Field Values

### CACHE_POLICY_DEFAULT

    static final String CACHE_POLICY_DEFAULT

  Deprecated. since 3.0 use `QueryCacheStrategy` enum.
  See Also:
    Constant Field Values

Method Detail

### getClassDescriptor

    ClassDescriptor getClassDescriptor()

  Since:
    3.0

### getObjEntity

    ObjEntity getObjEntity()

  Returns an ObjEntity associated with a query or null if no such entity exists.

### getDbEntity

    DbEntity getDbEntity()

  Returns a DbEntity associated with a query or null if no such entity exists.

### getProcedure

    Procedure getProcedure()

  Returns a Procedure associated with a query or null if no such procedure exists.

### getDataMap

    DataMap getDataMap()

  Returns a DataMap associated with a query or null if no such DataMap exists.

### getCachePolicy

    String getCachePolicy()

  Deprecated. since 3.0 `getCacheStrategy()` replaces this method.

  Returns query cache policy, which can be one of `NO_CACHE`, `LOCAL_CACHE`, or `SHARED_CACHE`. NO_CACHE is generally a default policy.

### getCacheStrategy

    QueryCacheStrategy getCacheStrategy()

  Returns a caching strategy for this query.

  Since:
    3.0

### getCacheKey

    String getCacheKey()

  Returns a String that uniquely identifies this query for the purposes of result caching. If null is returned, no caching is performed.

### getCacheGroups

    String[] getCacheGroups()

  Returns an optional array of cache "groups". Cache groups allow to invalidate query caches in bulk on different events. Usually the first group in the array is considered to be the "main" group that is used for declarative cache invalidation with some cache providers.

  Since:
    3.0

### isFetchingDataRows

    boolean isFetchingDataRows()

  Returns `true` if this query should produce a list of data rows as opposed to DataObjects, `false` for DataObjects. This is a hint to QueryEngine executing this query.

### isRefreshingObjects

    boolean isRefreshingObjects()

  Deprecated. since 3.0. With introduction of the cache strategies this setting is redundant, although it is still being taken into account. It will be removed in the later versions of Cayenne.

  Returns `true` if the query results should replace any currently cached values, returns `false` otherwise. If `isFetchingDataRows()`returns `true`, this setting is not applicable and has no effect.

### isResolvingInherited

    boolean isResolvingInherited()

  Returns true if objects fetched via this query should be fully resolved according to the inheritance hierarchy.

### getPageSize

    int getPageSize()

  Returns query page size. Page size is a hint to Cayenne that query should be performed page by page, instead of retrieving all results at once. If the value returned is less than or equal to zero, no paging should occur.

### getFetchStartIndex

    int getFetchStartIndex()

  Specifies a start of a range when fetching a subset of records. The last index is determined by `getFetchLimit()`.

### getFetchLimit

    int getFetchLimit()

  Returns the limit on the maximum number of records that can be returned by this query. If the actual number of rows in the result exceeds the fetch limit, they will be discarded. One possible use of fetch limit is using it as a safeguard against large result sets that may lead to the application running out of memory, etc. If a fetch limit is greater or equal to zero, all rows will be returned.

  Returns:
    the limit on the maximum number of records that can be returned by this query

### getOrginatingQuery

    Query getOrginatingQuery()

  Returns a query that originated this query. Originating query is a query whose result is needed to obtain the result of the query owning this metadata. Most often than not the returned value is null. One example of non-null originating query is a query for a range of objects in a previously fetched paginated list. The query that fetched the original paginated list is an "originated" query. It may be used to restore a list that got lost due to a cache overflow, etc.

  Since:
    3.0

### getPrefetchTree

    PrefetchTreeNode getPrefetchTree()

  Returns a root node of prefetch tree used by this query, or null of no prefetches are configured.

### getPathSplitAliases

    Map<String,String> getPathSplitAliases()

  Returns a map of aliases vs. expression subpaths that is used to build split joins.

  Since:
    3.0

### getResultSetMapping

    SQLResultSetMapping getResultSetMapping()

  Returns a mapping of the result set data rows. Can be null. If not null overrides prefetching and data row settings.

  Since:
    3.0

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

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