Package org.apache.cayenne.query
Class QueryChain
java.lang.Object
org.apache.cayenne.query.QueryChain
- All Implemented Interfaces:
Serializable
,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:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates 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 Summary
Modifier and TypeMethodDescriptionvoid
Adds a query to the chain.createSQLAction
(SQLActionVisitor visitor) Throws an exception as execution should've been delegated to the queries contained in the chain.getMetaData
(EntityResolver resolver) Returns default metadata.boolean
isEmpty()
boolean
removeQuery
(Query query) Removes a query from the chain, returning true if the query was indeed present in the chain and was removed.void
route
(QueryRouter router, EntityResolver resolver, Query substitutedQuery) Delegates routing to each individual query in the chain.
-
Field Details
-
chain
-
-
Constructor Details
-
QueryChain
public QueryChain()Creates an empty QueryChain. -
QueryChain
Creates a new QueryChain out of an array of queries. -
QueryChain
Creates a new QueryChain with a collection of Queries.
-
-
Method Details
-
addQuery
Adds a query to the chain. -
removeQuery
Removes a query from the chain, returning true if the query was indeed present in the chain and was removed. -
isEmpty
public boolean isEmpty() -
route
Delegates routing to each individual query in the chain. If there is no queries, this method does nothing. -
createSQLAction
Throws an exception as execution should've been delegated to the queries contained in the chain.- Specified by:
createSQLAction
in interfaceQuery
-
getMetaData
Returns default metadata.- Specified by:
getMetaData
in interfaceQuery
-