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:
- Serialized Form
- 
Field SummaryFields Modifier and Type Field Description static StringDATA_MAP_ROOTprotected DataMapdataMapstatic StringDB_ENTITY_ROOTstatic StringEJBQL_QUERYstatic StringJAVA_CLASS_ROOTprotected Stringnamestatic StringOBJ_ENTITY_ROOTstatic StringPROCEDURE_QUERYstatic StringPROCEDURE_ROOTprotected Map<String,String>propertiesprotected Objectrootstatic StringSELECT_QUERYstatic StringSQL_TEMPLATEprotected Stringtype
- 
Constructor SummaryConstructors Modifier Constructor Description protectedQueryDescriptor(String type)
- 
Method SummaryModifier and Type Method Description <T> TacceptVisitor(ConfigurationNodeVisitor<T> visitor)QuerybuildQuery()Assembles Cayenne query instance of appropriate type from this descriptor.static QueryDescriptordescriptor(String type)Creates query descriptor of a given type.static EJBQLQueryDescriptorejbqlQueryDescriptor()Creates new EJBQLQuery query descriptor.voidencodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor delegate)Prints itself as XML to the provided XMLEncoder.DataMapgetDataMap()StringgetName()Returns name of the query.Map<String,String>getProperties()Returns map of query properties set up for this query.StringgetProperty(String name)Returns query property by its name.ObjectgetRoot()Returns the root of this query.StringgetType()Returns type of the query.static ProcedureQueryDescriptorprocedureQueryDescriptor()Creates new ProcedureQuery query descriptor.static SelectQueryDescriptorselectQueryDescriptor()Creates new SelectQuery query descriptor.voidsetDataMap(DataMap dataMap)voidsetName(String name)Sets name of the query.voidsetProperties(Map<String,String> properties)Sets map of query properties for this query.voidsetProperty(String name, String value)Sets single query property.voidsetRoot(Object root)Sets the root of this query.voidsetType(String type)Sets type of the query.static SQLTemplateDescriptorsqlTemplateDescriptor()Creates new SQLTemplate query descriptor.
- 
Field Details- 
SELECT_QUERY- See Also:
- Constant Field Values
 
- 
SQL_TEMPLATE- See Also:
- Constant Field Values
 
- 
EJBQL_QUERY- See Also:
- Constant Field Values
 
- 
PROCEDURE_QUERY- See Also:
- Constant Field Values
 
- 
OBJ_ENTITY_ROOT- Since:
- 4.1
- See Also:
- Constant Field Values
 
- 
DB_ENTITY_ROOT- Since:
- 4.1
- See Also:
- Constant Field Values
 
- 
PROCEDURE_ROOT- Since:
- 4.1
- See Also:
- Constant Field Values
 
- 
DATA_MAP_ROOT- Since:
- 4.1
- See Also:
- Constant Field Values
 
- 
JAVA_CLASS_ROOT- Since:
- 4.1
- See Also:
- Constant Field Values
 
- 
name
- 
type
- 
dataMap
- 
root
- 
properties
 
- 
- 
Constructor Details- 
QueryDescriptor
 
- 
- 
Method Details- 
selectQueryDescriptorCreates new SelectQuery query descriptor.
- 
sqlTemplateDescriptorCreates new SQLTemplate query descriptor.
- 
procedureQueryDescriptorCreates new ProcedureQuery query descriptor.
- 
ejbqlQueryDescriptorCreates new EJBQLQuery query descriptor.
- 
descriptorCreates query descriptor of a given type.
- 
getNameReturns name of the query.
- 
setNameSets name of the query.
- 
getTypeReturns type of the query.
- 
setTypeSets type of the query.
- 
getDataMap
- 
setDataMap
- 
getRootReturns the root of this query.
- 
setRootSets the root of this query.
- 
getPropertiesReturns map of query properties set up for this query.
- 
getPropertyReturns query property by its name.
- 
setPropertiesSets map of query properties for this query.
- 
setPropertySets single query property.
- 
buildQueryAssembles Cayenne query instance of appropriate type from this descriptor.
- 
acceptVisitor- Specified by:
- acceptVisitorin interface- ConfigurationNode
 
- 
encodeAsXMLDescription copied from interface:XMLSerializablePrints itself as XML to the provided XMLEncoder.- Specified by:
- encodeAsXMLin interface- XMLSerializable
 
 
-