org.apache.cayenne.map

## 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 and Description
    --- | ---
    `protected List<Ordering>` | `orderings`
    `protected List<String>` | `prefetches`
    `protected Expression` | `qualifier`

    - ### Fields inherited from class org.apache.cayenne.map.QueryDescriptor

      `dataMap, EJBQL_QUERY, name, PROCEDURE_QUERY, properties, root, SELECT_QUERY, SQL_TEMPLATE, type`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SelectQueryDescriptor()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addOrdering(Ordering ordering)` Adds single ordering for this query.
    `void` | `addPrefetch(String prefetchPath)` Adds single prefetch path to this query.
    `SelectQuery<?>` | `buildQuery()` Assembles Cayenne query instance of appropriate type from this descriptor.
    `void` | `encodeAsXML(XMLEncoder encoder)` Prints itself as XML to the provided XMLEncoder.
    `List<Ordering>` | `getOrderings()` Returns list of orderings for this query.
    `List<String>` | `getPrefetches()` Returns list of prefetch paths 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` | `setPrefetches(List<String> prefetches)` Sets list of prefetch paths for this query.
    `void` | `setQualifier(Expression qualifier)` Sets qualifier for this query.

    - ### Methods inherited from class org.apache.cayenne.map.QueryDescriptor

      `acceptVisitor, descriptor, ejbqlQueryDescriptor, getDataMap, getName, getProperties, getProperty, getRoot, getType, procedureQueryDescriptor, selectQueryDescriptor, setDataMap, setName, setProperties, setProperty, setRoot, setType, sqlTemplateDescriptor`

    - ### Methods inherited from class java.lang.Object

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

- - ### Field Detail

    - #### qualifier

          protected Expression qualifier

    - #### orderings

          protected List<Ordering> orderings

    - #### prefetches

          protected List<String> prefetches

  - ### Constructor Detail

    - #### SelectQueryDescriptor

          public SelectQueryDescriptor()

  - ### Method Detail

    - #### 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.

    - #### getPrefetches

          public List<String> getPrefetches()

      Returns list of prefetch paths for this query.

    - #### setPrefetches

          public void setPrefetches(List<String> prefetches)

      Sets list of prefetch paths for this query.

    - #### addPrefetch

          public void addPrefetch(String prefetchPath)

      Adds single prefetch path to this query.

    - #### removePrefetch

          public void removePrefetch(String prefetchPath)

      Removes single prefetch path from this query.

    - #### buildQuery

          public SelectQuery<?> 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)

      Description copied from interface: `XMLSerializable`
      Prints itself as XML to the provided XMLEncoder.
      Specified by:
        `encodeAsXML` in interface `XMLSerializable`
      Overrides:
        `encodeAsXML` in class `QueryDescriptor`

Copyright © 2001–2023 Apache Cayenne. All rights reserved.