Class QueryDescriptor

java.lang.Object
org.apache.cayenne.map.QueryDescriptor
All Implemented Interfaces:
ProjectNode, XMLSerializable
Direct Known Subclasses:
ProcedureQueryDescriptor, SelectQueryDescriptor, SQLTemplateDescriptor

public abstract class QueryDescriptor extends Object implements ProjectNode, XMLSerializable
Generic descriptor of a Cayenne query.
Since:
4.0
  • Field Details

  • Constructor Details

    • QueryDescriptor

      public QueryDescriptor()
  • Method Details

    • getName

      public String getName()
      Returns name of the query.
    • setName

      public void setName(String name)
      Sets name of the query.
    • getDataMap

      public DataMap getDataMap()
    • setDataMap

      public void setDataMap(DataMap dataMap)
    • getRoot

      public Object getRoot()
      Returns the root of this query.
    • setRoot

      public void setRoot(Object root)
      Sets the root of this query.
    • getPageSize

      public int getPageSize()
      Returns the page size of the query. Zero means no pagination.
      Since:
      5.0
    • setPageSize

      public void setPageSize(int pageSize)
      Since:
      5.0
    • getStatementFetchSize

      public int getStatementFetchSize()
      Returns the JDBC statement fetch size of the query. Zero means the driver default.
      Since:
      5.0
    • setStatementFetchSize

      public void setStatementFetchSize(int statementFetchSize)
      Since:
      5.0
    • isFetchingDataRows

      public boolean isFetchingDataRows()
      Returns whether the query fetches DataRows instead of Persistent objects.
      Since:
      5.0
    • setFetchingDataRows

      public void setFetchingDataRows(boolean fetchingDataRows)
      Since:
      5.0
    • getCacheStrategy

      public QueryCacheStrategy getCacheStrategy()
      Returns the cache strategy of the query, that is never null.
      Since:
      5.0
    • setCacheStrategy

      public void setCacheStrategy(QueryCacheStrategy cacheStrategy)
      Sets the cache strategy of the query. A null value resets it to the default strategy.
      Since:
      5.0
    • getCacheGroup

      public String getCacheGroup()
      Returns the cache group of the query, or null if none is set.
      Since:
      5.0
    • setCacheGroup

      public void setCacheGroup(String cacheGroup)
      Since:
      5.0
    • buildQuery

      public abstract Query buildQuery()
      Assembles Cayenne query instance of appropriate type from this descriptor.
    • buildQuery

      public abstract Query buildQuery(Map<String,?> parameters)
      Assembles Cayenne query instance of appropriate type from this descriptor, applying a map of named parameters to it.
      Since:
      5.0
    • acceptVisitor

      public <T> T acceptVisitor(ProjectNodeVisitor<T> visitor)
      Specified by:
      acceptVisitor in interface ProjectNode