Package org.apache.cayenne.query
Class QueryChain
java.lang.Object
org.apache.cayenne.query.QueryChain
- All Implemented Interfaces:
- Serializable,- Query
public class QueryChain extends Object implements Query
A Query decorator for a collection of other queries. Note that QueryChain will always
 return DataRows (that is if it returns data), as it has no way of knowing how to
 convert the results to objects.
- Since:
- 1.2
- See Also:
- Serialized Form
- 
Field SummaryFields Modifier and Type Field Description protected Collection<Query>chain
- 
Constructor SummaryConstructors Constructor Description QueryChain()Creates an empty QueryChain.QueryChain(Collection<? extends Query> queries)Creates a new QueryChain with a collection of Queries.QueryChain(Query[] queries)Creates a new QueryChain out of an array of queries.
- 
Method SummaryModifier and Type Method Description voidaddQuery(Query query)Adds a query to the chain.SQLActioncreateSQLAction(SQLActionVisitor visitor)Throws an exception as execution should've been delegated to the queries contained in the chain.QueryMetadatagetMetaData(EntityResolver resolver)Returns default metadata.booleanisEmpty()booleanremoveQuery(Query query)Removes a query from the chain, returning true if the query was indeed present in the chain and was removed.voidroute(QueryRouter router, EntityResolver resolver, Query substitutedQuery)Delegates routing to each individual query in the chain.
- 
Field Details- 
chain
 
- 
- 
Constructor Details- 
QueryChainpublic QueryChain()Creates an empty QueryChain.
- 
QueryChainCreates a new QueryChain out of an array of queries.
- 
QueryChainCreates a new QueryChain with a collection of Queries.
 
- 
- 
Method Details- 
addQueryAdds a query to the chain.
- 
removeQueryRemoves a query from the chain, returning true if the query was indeed present in the chain and was removed.
- 
isEmptypublic boolean isEmpty()
- 
routeDelegates routing to each individual query in the chain. If there is no queries, this method does nothing.
- 
createSQLActionThrows an exception as execution should've been delegated to the queries contained in the chain.- Specified by:
- createSQLActionin interface- Query
 
- 
getMetaDataReturns default metadata.- Specified by:
- getMetaDatain interface- Query
 
 
-