Package org.apache.cayenne.query
Class FluentSelect<T>
java.lang.Object
org.apache.cayenne.query.CacheableQuery
org.apache.cayenne.query.AbstractQuery
org.apache.cayenne.query.FluentSelect<T>
- All Implemented Interfaces:
Serializable,Query,Select<T>
- Direct Known Subclasses:
ColumnSelect,ObjectSelect
Base class for
ObjectSelect and ColumnSelect- Since:
- 4.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected Class<?> protected Expressionprotected Collection<Ordering> protected ExpressionFields inherited from class org.apache.cayenne.query.AbstractQuery
rootFields inherited from class org.apache.cayenne.query.CacheableQuery
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbatchIterator(ObjectContext context, int size) Creates a ResultBatchIterator based on the provided context and batch size.createSQLAction(SQLActionVisitor visitor) A callback method invoked by Cayenne during the final execution phase of the query run.Collection<Property<?>> Class<?> Returns a HAVING clause Expression of this query.intgetLimit()intintintintgetWhere()Returns a WHERE clause Expression of this query.voidinitWithProperties(Map<String, String> properties) booleanbooleanvoiditerate(ObjectContext context, ResultIteratorCallback<T> callback) Creates a ResultIterator based on the provided context and passes it to a callback for processing.iterator(ObjectContext context) Creates a ResultIterator based on the provided context.protected ObjectresolveRoot(EntityResolver resolver) voidroute(QueryRouter router, EntityResolver resolver, Query substitutedQuery) Implements default routing mechanism relying on the EntityResolver to find DataMap based on the query root.protected voidroutePrefetches(QueryRouter router, EntityResolver resolver) select(ObjectContext context) Selects objects using provided context.selectOne(ObjectContext context) Selects a single object using provided context.Methods inherited from class org.apache.cayenne.query.AbstractQuery
getMetaData, getRoot, setRoot, toStringMethods inherited from class org.apache.cayenne.query.CacheableQuery
getBaseMetaData, getCacheGroup, getCacheStrategy, setCacheGroup, setCacheStrategy, useLocalCache, useLocalCache, useSharedCache, useSharedCacheMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.cayenne.query.Query
getMetaDataMethods inherited from interface org.apache.cayenne.query.Select
selectFirst
-
Field Details
-
entityType
-
entityName
-
dbEntityName
-
where
-
having
-
orderings
-
-
Constructor Details
-
FluentSelect
protected FluentSelect()
-
-
Method Details
-
resolveRoot
-
getStatementFetchSize
public int getStatementFetchSize() -
getQueryTimeout
public int getQueryTimeout()- Since:
- 4.2
-
getPageSize
public int getPageSize() -
getLimit
public int getLimit() -
getOffset
public int getOffset() -
getEntityType
-
getEntityName
-
getDbEntityName
-
getWhere
Returns a WHERE clause Expression of this query. -
getHaving
Returns a HAVING clause Expression of this query. -
getOrderings
-
getPrefetches
-
select
Description copied from interface:SelectSelects objects using provided context.Essentially the inversion of "ObjectContext.select(Select)".
-
selectOne
Description 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)".
-
iterate
Description 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)".
-
iterator
Description 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)".
-
batchIterator
Description 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 interfaceSelect<T>
-
createSQLAction
Description copied from interface:QueryA callback method invoked by Cayenne during the final execution phase of the query run. A concrete query implementation is given a chance to decide how it should be handled. Implementors can pick an appropriate method of the SQLActionVisitor to handle itself, create a custom SQLAction of its own, or substitute itself with another query that should be used for SQLAction construction.- Specified by:
createSQLActionin interfaceQuery- Specified by:
createSQLActionin classAbstractQuery
-
route
Description copied from class:AbstractQueryImplements default routing mechanism relying on the EntityResolver to find DataMap based on the query root. This mechanism should be sufficient for most queries that "know" their root.- Specified by:
routein interfaceQuery- Overrides:
routein classAbstractQuery
-
isFetchingDataRows
public boolean isFetchingDataRows() -
routePrefetches
-
getColumns
- Since:
- 4.2
-
isDistinct
public boolean isDistinct()- Since:
- 4.2
-
initWithProperties
- Since:
- 4.2
-