SelectQueryDescriptor (cayenne-doc: Cayenne Documentation 5.0-M2 API)
Description: declaration: package: org.apache.cayenne.map, class: SelectQueryDescriptor

# Class SelectQueryDescriptor

java.lang.Object
org.apache.cayenne.map.QueryDescriptor
org.apache.cayenne.map.SelectQueryDescriptor

All Implemented Interfaces:
  `Serializable, ConfigurationNode, XMLSerializable`

public class SelectQueryDescriptor extends QueryDescriptor

Since:
  4.0
See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final boolean`
  `DISTINCT_DEFAULT`
  `static final String`
  `DISTINCT_PROPERTY`
  `protected List<Ordering>`
  `orderings`
  `protected Map<String,Integer>`
  `prefetchesMap`
  `protected Expression`
  `qualifier`

  ### Fields 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`
  Modifier and Type
  Field
  Description
  `static final String`
  `DATA_MAP_ROOT`
  `protected DataMap`
  `dataMap`
  `static final String`
  `DB_ENTITY_ROOT`
  `static final String`
  `EJBQL_QUERY`
  `static final String`
  `JAVA_CLASS_ROOT`
  `protected String`
  `name`
  `static final String`
  `OBJ_ENTITY_ROOT`
  `static final String`
  `PROCEDURE_QUERY`
  `static final String`
  `PROCEDURE_ROOT`
  `protected Map<String,String>`
  `properties`
  `protected Object`
  `root`
  `static final String`
  `SELECT_QUERY`
  `static final String`
  `SQL_TEMPLATE`
  `protected String`
  `type`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SelectQueryDescriptor()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addOrdering(Ordering ordering)`
  Adds single ordering for this query.
  `void`
  `addPrefetch(String prefetchPath, int semantics)`
  Adds prefetch path with semantics to this query.
  `ObjectSelect<?>`
  `buildQuery()`
  Assembles Cayenne query instance of appropriate type from this descriptor.
  `void`
  `encodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor delegate)`
  Prints itself as XML to the provided XMLEncoder.
  `List<Ordering>`
  `getOrderings()`
  Returns list of orderings for this query.
  `Map<String,Integer>`
  `getPrefetchesMap()`
  Returns map of prefetch paths with semantics for this query.
  `Expression`
  `getQualifier()`
  Returns qualifier of this query.
  `boolean`
  `isDistinct()`
  `void`
  `removeOrdering(Ordering ordering)`
  Removes single ordering from this query.
  `void`
  `removePrefetch(String prefetchPath)`
  Removes single prefetch path from this query.
  `void`
  `setDistinct(boolean value)`
  `void`
  `setOrderings(List<Ordering> orderings)`
  Sets list of orderings for this query.
  `void`
  `setPrefetchesMap(HashMap<String,Integer> prefetchesMap)`
  Sets map of prefetch paths with semantics for this query.
  `void`
  `setQualifier(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, sqlTemplateDescriptor`
  Modifier and Type
  Method
  Description
  `<T> T`
  `acceptVisitor(ConfigurationNodeVisitor<T> visitor)`
  `static QueryDescriptor`
  `descriptor(String type)`
  Creates query descriptor of a given type.
  `static EJBQLQueryDescriptor`
  `ejbqlQueryDescriptor()`
  Creates new EJBQLQuery query descriptor.
  `DataMap`
  `getDataMap()`
  `String`
  `getName()`
  Returns name of the query.
  `Map<String,String>`
  `getProperties()`
  Returns map of query properties set up for this query.
  `String`
  `getProperty(String name)`
  Returns query property by its name.
  `Object`
  `getRoot()`
  Returns the root of this query.
  `String`
  `getType()`
  Returns type of the query.
  `static ProcedureQueryDescriptor`
  `procedureQueryDescriptor()`
  Creates new ProcedureQuery query descriptor.
  `static SelectQueryDescriptor`
  `selectQueryDescriptor()`
  Creates new SelectQuery query descriptor.
  `void`
  `setDataMap(DataMap dataMap)`
  `void`
  `setName(String name)`
  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`
  `setRoot(Object root)`
  Sets the root of this query.
  `void`
  `setType(String type)`
  Sets type of the query.
  `static SQLTemplateDescriptor`
  `sqlTemplateDescriptor()`
  Creates new SQLTemplate query descriptor.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### DISTINCT_PROPERTY

    public static final String DISTINCT_PROPERTY
    See Also:
      - Constant Field Values

  - ### DISTINCT_DEFAULT

    public static final boolean DISTINCT_DEFAULT
    See Also:
      - Constant Field Values

  - ### qualifier

    protected Expression qualifier

  - ### orderings

    protected List<Ordering> orderings

  - ### prefetchesMap

    protected Map<String,Integer> prefetchesMap

- ## Constructor Details

  - ### SelectQueryDescriptor

    public SelectQueryDescriptor()

- ## Method Details

  - ### setDistinct

    public void setDistinct(boolean value)

  - ### isDistinct

    public boolean isDistinct()

  - ### getQualifier

    public Expression getQualifier()
    Returns qualifier of this query.

  - ### setQualifier

    public void setQualifier(Expression qualifier)
    Sets qualifier for this query.

  - ### getOrderings

    public List<Ordering> getOrderings()
    Returns list of orderings for this query.

  - ### setOrderings

    public void setOrderings(List<Ordering> orderings)
    Sets list of orderings for this query.

  - ### addOrdering

    public void addOrdering(Ordering ordering)
    Adds single ordering for this query.

  - ### removeOrdering

    public void removeOrdering(Ordering ordering)
    Removes single ordering from this query.

  - ### getPrefetchesMap

    public Map<String,Integer> getPrefetchesMap()
    Returns map of prefetch paths with semantics for this query.
    Since:
      4.1

  - ### setPrefetchesMap

    public void setPrefetchesMap(HashMap<String,Integer> prefetchesMap)
    Sets map of prefetch paths with semantics for this query.
    Since:
      4.1

  - ### addPrefetch

    public void addPrefetch(String prefetchPath, int semantics)
    Adds prefetch path with semantics to this query.
    Since:
      4.1

  - ### removePrefetch

    public void removePrefetch(String prefetchPath)
    Removes single prefetch path from this query.

  - ### buildQuery

    public ObjectSelect<?> buildQuery()
    Description copied from class: `QueryDescriptor`
    Assembles Cayenne query instance of appropriate type from this descriptor.
    Overrides:
      `buildQuery` in class `QueryDescriptor`

  - ### encodeAsXML

    public void encodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor delegate)
    Description copied from interface: `XMLSerializable`
    Prints itself as XML to the provided XMLEncoder.
    Specified by:
      `encodeAsXML` in interface `XMLSerializable`
    Overrides:
      `encodeAsXML` in class `QueryDescriptor`