Package org.apache.cayenne.query
Class FluentSelect<T>
java.lang.Object
org.apache.cayenne.query.IndirectQuery
org.apache.cayenne.query.FluentSelect<T>
- All Implemented Interfaces:
- Serializable,- Query,- Select<T>
- Direct Known Subclasses:
- ColumnSelect,- ObjectSelect
public abstract class FluentSelect<T> extends IndirectQuery implements Select<T>
Base class for 
ObjectSelect and ColumnSelect- Since:
- 4.0
- See Also:
- Serialized Form
- 
Field SummaryFields Modifier and Type Field Description protected StringcacheGroupprotected QueryCacheStrategycacheStrategyprotected StringdbEntityNameprotected StringentityNameprotected Class<?>entityTypeprotected intlimitprotected intoffsetprotected Collection<Ordering>orderingsprotected intpageSizeprotected PrefetchTreeNodeprefetchesprotected intstatementFetchSizeprotected ExpressionwhereFields inherited from class org.apache.cayenne.query.IndirectQuerydataMap, lastResolver, name, replacementQuery
- 
Constructor SummaryConstructors Modifier Constructor Description protectedFluentSelect()
- 
Method SummaryModifier and Type Method Description ResultBatchIterator<T>batchIterator(ObjectContext context, int size)Creates a ResultBatchIterator based on the provided context and batch size.protected QuerycreateReplacementQuery(EntityResolver resolver)Translates self to a SelectQuery.StringgetCacheGroup()QueryCacheStrategygetCacheStrategy()StringgetDbEntityName()StringgetEntityName()Class<?>getEntityType()intgetLimit()intgetOffset()Collection<Ordering>getOrderings()intgetPageSize()PrefetchTreeNodegetPrefetches()intgetStatementFetchSize()ExpressiongetWhere()Returns a WHERE clause Expression of this query.voiditerate(ObjectContext context, ResultIteratorCallback<T> callback)Creates a ResultIterator based on the provided context and passes it to a callback for processing.ResultIterator<T>iterator(ObjectContext context)Creates a ResultIterator based on the provided context.List<T>select(ObjectContext context)Selects objects using provided context.TselectOne(ObjectContext context)Selects a single object using provided context.Methods inherited from class org.apache.cayenne.query.IndirectQuerycreateSQLAction, getMetaData, getReplacementQuery, routeMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.cayenne.query.QuerycreateSQLAction, getMetaData, routeMethods inherited from interface org.apache.cayenne.query.SelectselectFirst
- 
Field Details- 
entityType
- 
entityName
- 
dbEntityName
- 
where
- 
orderings
- 
prefetches
- 
limitprotected int limit
- 
offsetprotected int offset
- 
pageSizeprotected int pageSize
- 
statementFetchSizeprotected int statementFetchSize
- 
cacheStrategy
- 
cacheGroup
 
- 
- 
Constructor Details- 
FluentSelectprotected FluentSelect()
 
- 
- 
Method Details- 
createReplacementQueryTranslates self to a SelectQuery.- Specified by:
- createReplacementQueryin class- IndirectQuery
 
- 
getCacheGroup
- 
getCacheStrategy
- 
getStatementFetchSizepublic int getStatementFetchSize()
- 
getPageSizepublic int getPageSize()
- 
getLimitpublic int getLimit()
- 
getOffsetpublic int getOffset()
- 
getEntityType
- 
getEntityName
- 
getDbEntityName
- 
getWhereReturns a WHERE clause Expression of this query.
- 
getOrderings
- 
getPrefetches
- 
selectDescription copied from interface:SelectSelects objects using provided context.Essentially the inversion of "ObjectContext.select(Select)". 
- 
selectOneDescription copied from interface:SelectSelects a single object using provided context. The query is expected to match zero or one object. It returns null if no objects were matched. If query matched more than one object,CayenneRuntimeExceptionis thrown.Essentially the inversion of "ObjectContext.selectOne(Select)". 
- 
iterateDescription copied from interface:SelectCreates a ResultIterator based on the provided context and passes it to a callback for processing. The caller does not need to worry about closing the iterator. This method takes care of it.Essentially the inversion of "ObjectContext.iterate(Select, ResultIteratorCallback)". 
- 
iteratorDescription copied from interface:SelectCreates a ResultIterator based on the provided context. It is usually backed by an open result set and is useful for processing of large data sets, preserving a constant memory footprint. The caller must wrap iteration in try/finally (or try-with-resources for Java 1.7 and higher) and close the ResultIterator explicitly. Or useSelect.iterate(ObjectContext, ResultIteratorCallback)as an alternative.Essentially the inversion of "ObjectContext.iterator(Select)". 
- 
batchIteratorDescription copied from interface:SelectCreates a ResultBatchIterator based on the provided context and batch size. It is usually backed by an open result set and is useful for processing of large data sets, preserving a constant memory footprint. The caller must wrap iteration in try/finally (or try-with-resources for Java 1.7 and higher) and close the ResultBatchIterator explicitly.- Specified by:
- batchIteratorin interface- Select<T>
 
 
-