Package org.apache.cayenne.query
Class QueryMetadataProxy
java.lang.Object
org.apache.cayenne.query.QueryMetadataProxy
- All Implemented Interfaces:
- QueryMetadata
public class QueryMetadataProxy extends Object implements QueryMetadata
- Since:
- 4.0
- 
Field SummaryFields Modifier and Type Field Description protected QueryMetadatamdDelegateFields inherited from interface org.apache.cayenne.query.QueryMetadataCACHE_GROUPS_PROPERTY, CACHE_STRATEGY_PROPERTY, FETCH_LIMIT_DEFAULT, FETCH_LIMIT_PROPERTY, FETCH_OFFSET_DEFAULT, FETCH_OFFSET_PROPERTY, FETCHING_DATA_ROWS_DEFAULT, FETCHING_DATA_ROWS_PROPERTY, PAGE_SIZE_DEFAULT, PAGE_SIZE_PROPERTY, STATEMENT_FETCH_SIZE_DEFAULT, STATEMENT_FETCH_SIZE_PROPERTY
- 
Constructor SummaryConstructors Modifier Constructor Description protectedQueryMetadataProxy(QueryMetadata mdDelegate)
- 
Method SummaryModifier and Type Method Description StringgetCacheGroup()Returns an optional cache "group".StringgetCacheKey()Returns a String that uniquely identifies this query for the purposes of result caching.QueryCacheStrategygetCacheStrategy()Returns a caching strategy for this query.ClassDescriptorgetClassDescriptor()DataMapgetDataMap()Returns a DataMap associated with a query or null if no such DataMap exists.DbEntitygetDbEntity()Returns a DbEntity associated with a query or null if no such entity exists.intgetFetchLimit()Returns the limit on the maximum number of records that can be returned by this query.intgetFetchOffset()Specifies a start of a range when fetching a subset of records.ObjEntitygetObjEntity()Returns an ObjEntity associated with a query or null if no such entity exists.QuerygetOriginatingQuery()Returns a query that originated this query.intgetPageSize()Returns query page size.Map<String,String>getPathSplitAliases()Returns a map of aliases vs.PrefetchTreeNodegetPrefetchTree()Returns a root node of prefetch tree used by this query, or null of no prefetches are configured.ProceduregetProcedure()Returns a Procedure associated with a query or null if no such procedure exists.List<Object>getResultSetMapping()Returns an optional list of result set mapping hints.intgetStatementFetchSize()booleanisFetchingDataRows()Returnstrueif this query should produce a list of data rows as opposed to DataObjects,falsefor DataObjects.booleanisRefreshingObjects()Returnstrueif the query results should replace any currently cached values, returnsfalseotherwise.booleanisSingleResultSetMapping()booleanisSuppressingDistinct()
- 
Field Details- 
mdDelegate
 
- 
- 
Constructor Details- 
QueryMetadataProxy
 
- 
- 
Method Details- 
getCacheGroupDescription copied from interface:QueryMetadataReturns an optional cache "group". Cache groups allow to invalidate query caches in bulk on different events.- Specified by:
- getCacheGroupin interface- QueryMetadata
 
- 
getCacheKeyDescription copied from interface:QueryMetadataReturns a String that uniquely identifies this query for the purposes of result caching. If null is returned, no caching is performed.- Specified by:
- getCacheKeyin interface- QueryMetadata
 
- 
getCacheStrategyDescription copied from interface:QueryMetadataReturns a caching strategy for this query.- Specified by:
- getCacheStrategyin interface- QueryMetadata
 
- 
getClassDescriptor- Specified by:
- getClassDescriptorin interface- QueryMetadata
 
- 
getDataMapDescription copied from interface:QueryMetadataReturns a DataMap associated with a query or null if no such DataMap exists.- Specified by:
- getDataMapin interface- QueryMetadata
 
- 
getDbEntityDescription copied from interface:QueryMetadataReturns a DbEntity associated with a query or null if no such entity exists.- Specified by:
- getDbEntityin interface- QueryMetadata
 
- 
getFetchLimitpublic int getFetchLimit()Description copied from interface:QueryMetadataReturns 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.- Specified by:
- getFetchLimitin interface- QueryMetadata
- Returns:
- the limit on the maximum number of records that can be returned by this query
 
- 
getFetchOffsetpublic int getFetchOffset()Description copied from interface:QueryMetadataSpecifies a start of a range when fetching a subset of records.- Specified by:
- getFetchOffsetin interface- QueryMetadata
 
- 
getObjEntityDescription copied from interface:QueryMetadataReturns an ObjEntity associated with a query or null if no such entity exists.- Specified by:
- getObjEntityin interface- QueryMetadata
 
- 
getOriginatingQueryDescription copied from interface:QueryMetadataReturns 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.- Specified by:
- getOriginatingQueryin interface- QueryMetadata
 
- 
getPageSizepublic int getPageSize()Description copied from interface:QueryMetadataReturns 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.- Specified by:
- getPageSizein interface- QueryMetadata
 
- 
getPrefetchTreeDescription copied from interface:QueryMetadataReturns a root node of prefetch tree used by this query, or null of no prefetches are configured.- Specified by:
- getPrefetchTreein interface- QueryMetadata
 
- 
getPathSplitAliasesDescription copied from interface:QueryMetadataReturns a map of aliases vs. expression subpaths that is used to build split joins.- Specified by:
- getPathSplitAliasesin interface- QueryMetadata
 
- 
getProcedureDescription copied from interface:QueryMetadataReturns a Procedure associated with a query or null if no such procedure exists.- Specified by:
- getProcedurein interface- QueryMetadata
 
- 
getResultSetMappingDescription copied from interface:QueryMetadataReturns an optional list of result set mapping hints. Elements in the list can be eitherEntityResultSegmentorScalarResultSegment. The returned list can be null.- Specified by:
- getResultSetMappingin interface- QueryMetadata
 
- 
isSingleResultSetMappingpublic boolean isSingleResultSetMapping()- Specified by:
- isSingleResultSetMappingin interface- QueryMetadata
- Returns:
- should the result be mapped to single object (scalar or entity)
- See Also:
- QueryMetadata.getResultSetMapping()
 
- 
isFetchingDataRowspublic boolean isFetchingDataRows()Description copied from interface:QueryMetadataReturnstrueif this query should produce a list of data rows as opposed to DataObjects,falsefor DataObjects. This is a hint to QueryEngine executing this query.- Specified by:
- isFetchingDataRowsin interface- QueryMetadata
 
- 
isRefreshingObjectspublic boolean isRefreshingObjects()Description copied from interface:QueryMetadataReturnstrueif the query results should replace any currently cached values, returnsfalseotherwise. IfQueryMetadata.isFetchingDataRows()returnstrue, this setting is not applicable and has no effect.- Specified by:
- isRefreshingObjectsin interface- QueryMetadata
 
- 
getStatementFetchSizepublic int getStatementFetchSize()- Specified by:
- getStatementFetchSizein interface- QueryMetadata
- Returns:
- statement's fetch size
 
- 
isSuppressingDistinctpublic boolean isSuppressingDistinct()- Specified by:
- isSuppressingDistinctin interface- QueryMetadata
 
 
-