Package org.apache.cayenne.query
Class IndirectQuery
java.lang.Object
org.apache.cayenne.query.IndirectQuery
- All Implemented Interfaces:
Serializable
,Query
- Direct Known Subclasses:
AbstractMappedQuery
,ObjectIdQuery
,ProcedureCall
,RelationshipQuery
,SelectById
,SQLExec
,SQLSelect
A base superclass for queries that resolve into some other queries during the
routing phase. Provides caching of a replacement query.
- Since:
- 1.2
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected DataMap
protected EntityResolver
protected String
protected Query
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Query
createReplacementQuery
(EntityResolver resolver) Creates a substitute query.createSQLAction
(SQLActionVisitor visitor) Throws an exception as indirect query should not be executed directly.getMetaData
(EntityResolver resolver) Returns the metadata obtained from the replacement query.protected Query
getReplacementQuery
(EntityResolver resolver) Returns a replacement query, creating it on demand and caching it for reuse.void
route
(QueryRouter router, EntityResolver resolver, Query substitutedQuery) Delegates routing to a replacement query.
-
Field Details
-
name
-
dataMap
- Since:
- 3.1
-
replacementQuery
-
lastResolver
-
-
Constructor Details
-
IndirectQuery
public IndirectQuery()
-
-
Method Details
-
getMetaData
Returns the metadata obtained from the replacement query.- Specified by:
getMetaData
in interfaceQuery
-
route
Delegates routing to a replacement query. -
createReplacementQuery
Creates a substitute query. An implementor is free to provide an arbitrary replacement query. -
getReplacementQuery
Returns a replacement query, creating it on demand and caching it for reuse. -
createSQLAction
Throws an exception as indirect query should not be executed directly.- Specified by:
createSQLAction
in interfaceQuery
-