Package org.apache.cayenne.map
Class QueryDescriptor
java.lang.Object
org.apache.cayenne.map.QueryDescriptor
- All Implemented Interfaces:
Serializable
,ConfigurationNode
,XMLSerializable
- Direct Known Subclasses:
EJBQLQueryDescriptor
,ProcedureQueryDescriptor
,SelectQueryDescriptor
,SQLTemplateDescriptor
public class QueryDescriptor
extends Object
implements Serializable, ConfigurationNode, XMLSerializable
Generic descriptor of a Cayenne query.
- Since:
- 4.0
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> T
acceptVisitor
(ConfigurationNodeVisitor<T> visitor) Assembles Cayenne query instance of appropriate type from this descriptor.static QueryDescriptor
descriptor
(String type) Creates query descriptor of a given type.static EJBQLQueryDescriptor
Creates new EJBQLQuery query descriptor.void
encodeAsXML
(XMLEncoder encoder, ConfigurationNodeVisitor delegate) Prints itself as XML to the provided XMLEncoder.getName()
Returns name of the query.Returns map of query properties set up for this query.getProperty
(String name) Returns query property by its name.getRoot()
Returns the root of this query.getType()
Returns type of the query.static ProcedureQueryDescriptor
Creates new ProcedureQuery query descriptor.static SelectQueryDescriptor
Creates new SelectQuery query descriptor.void
setDataMap
(DataMap dataMap) void
Sets name of the query.void
setProperties
(Map<String, String> properties) Sets map of query properties for this query.void
setProperty
(String name, String value) Sets single query property.void
Sets the root of this query.void
Sets type of the query.static SQLTemplateDescriptor
Creates new SQLTemplate query descriptor.
-
Field Details
-
SELECT_QUERY
- See Also:
-
SQL_TEMPLATE
- See Also:
-
EJBQL_QUERY
- See Also:
-
PROCEDURE_QUERY
- See Also:
-
OBJ_ENTITY_ROOT
- Since:
- 4.1
- See Also:
-
DB_ENTITY_ROOT
- Since:
- 4.1
- See Also:
-
PROCEDURE_ROOT
- Since:
- 4.1
- See Also:
-
DATA_MAP_ROOT
- Since:
- 4.1
- See Also:
-
JAVA_CLASS_ROOT
- Since:
- 4.1
- See Also:
-
name
-
type
-
dataMap
-
root
-
properties
-
-
Constructor Details
-
QueryDescriptor
-
-
Method Details
-
selectQueryDescriptor
Creates new SelectQuery query descriptor. -
sqlTemplateDescriptor
Creates new SQLTemplate query descriptor. -
procedureQueryDescriptor
Creates new ProcedureQuery query descriptor. -
ejbqlQueryDescriptor
Creates new EJBQLQuery query descriptor. -
descriptor
Creates query descriptor of a given type. -
getName
Returns name of the query. -
setName
Sets name of the query. -
getType
Returns type of the query. -
setType
Sets type of the query. -
getDataMap
-
setDataMap
-
getRoot
Returns the root of this query. -
setRoot
Sets the root of this query. -
getProperties
Returns map of query properties set up for this query. -
getProperty
Returns query property by its name. -
setProperties
Sets map of query properties for this query. -
setProperty
Sets single query property. -
buildQuery
Assembles Cayenne query instance of appropriate type from this descriptor. -
acceptVisitor
- Specified by:
acceptVisitor
in interfaceConfigurationNode
-
encodeAsXML
Description copied from interface:XMLSerializable
Prints itself as XML to the provided XMLEncoder.- Specified by:
encodeAsXML
in interfaceXMLSerializable
-