Class SelectQueryDescriptor
java.lang.Object
org.apache.cayenne.map.QueryDescriptor
org.apache.cayenne.map.SelectQueryDescriptor
- All Implemented Interfaces:
Serializable, ConfigurationNode, XMLSerializable
- Since:
- 4.0
- See Also:
-
Field Summary
FieldsFields inherited from class QueryDescriptor
DATA_MAP_ROOT, dataMap, DB_ENTITY_ROOT, EJBQL_QUERY, JAVA_CLASS_ROOT, name, OBJ_ENTITY_ROOT, PROCEDURE_QUERY, PROCEDURE_ROOT, properties, root, SELECT_QUERY, SQL_TEMPLATE, type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOrdering(Ordering ordering) Adds single ordering for this query.voidaddPrefetch(String prefetchPath, int semantics) Adds prefetch path with semantics to this query.ObjectSelect<?> Assembles Cayenne query instance of appropriate type from this descriptor.voidencodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor delegate) Prints itself as XML to the provided XMLEncoder.Returns list of orderings for this query.Returns map of prefetch paths with semantics for this query.Returns qualifier of this query.booleanvoidremoveOrdering(Ordering ordering) Removes single ordering from this query.voidremovePrefetch(String prefetchPath) Removes single prefetch path from this query.voidsetDistinct(boolean value) voidsetOrderings(List<Ordering> orderings) Sets list of orderings for this query.voidsetPrefetchesMap(HashMap<String, Integer> prefetchesMap) Sets map of prefetch paths with semantics for this query.voidsetQualifier(Expression qualifier) Sets qualifier for this query.Methods inherited from class QueryDescriptor
acceptVisitor, descriptor, ejbqlQueryDescriptor, getDataMap, getName, getProperties, getProperty, getRoot, getType, procedureQueryDescriptor, selectQueryDescriptor, setDataMap, setName, setProperties, setProperty, setRoot, setType, sqlTemplateDescriptorModifier and TypeMethodDescription<T> TacceptVisitor(ConfigurationNodeVisitor<T> visitor) static QueryDescriptordescriptor(String type) Creates query descriptor of a given type.static EJBQLQueryDescriptorCreates new EJBQLQuery query descriptor.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 ProcedureQueryDescriptorCreates new ProcedureQuery query descriptor.static SelectQueryDescriptorCreates new SelectQuery query descriptor.voidsetDataMap(DataMap dataMap) voidSets 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.voidSets the root of this query.voidSets type of the query.static SQLTemplateDescriptorCreates new SQLTemplate query descriptor.
-
Field Details
-
DISTINCT_PROPERTY
- See Also:
-
DISTINCT_DEFAULT
public static final boolean DISTINCT_DEFAULT- See Also:
-
qualifier
-
orderings
-
prefetchesMap
-
-
Constructor Details
-
SelectQueryDescriptor
public SelectQueryDescriptor()
-
-
Method Details
-
setDistinct
public void setDistinct(boolean value) -
isDistinct
public boolean isDistinct() -
getQualifier
Returns qualifier of this query. -
setQualifier
Sets qualifier for this query. -
getOrderings
-
setOrderings
-
addOrdering
Adds single ordering for this query. -
removeOrdering
Removes single ordering from this query. -
getPrefetchesMap
-
setPrefetchesMap
-
addPrefetch
Adds prefetch path with semantics to this query.- Since:
- 4.1
-
removePrefetch
Removes single prefetch path from this query. -
buildQuery
Description copied from class:QueryDescriptorAssembles Cayenne query instance of appropriate type from this descriptor.- Overrides:
buildQueryin classQueryDescriptor
-
encodeAsXML
Description copied from interface:XMLSerializablePrints itself as XML to the provided XMLEncoder.- Specified by:
encodeAsXMLin interfaceXMLSerializable- Overrides:
encodeAsXMLin classQueryDescriptor
-