Class SQLTemplateDescriptor

java.lang.Object
org.apache.cayenne.map.QueryDescriptor
org.apache.cayenne.map.SQLTemplateDescriptor
All Implemented Interfaces:
Serializable, ConfigurationNode, XMLSerializable

public class SQLTemplateDescriptor
extends QueryDescriptor
Since:
4.0
See Also:
Serialized Form
  • Field Details

  • Constructor Details

    • SQLTemplateDescriptor

      public SQLTemplateDescriptor()
  • Method Details

    • getSql

      public String getSql()
      Returns default SQL statement for this query.
    • setSql

      public void setSql​(String sql)
      Sets default SQL statement for this query.
    • getAdapterSql

      public Map<String,​String> getAdapterSql()
      Returns map of db adapter specific SQL statements.
    • setAdapterSql

      public void setAdapterSql​(Map<String,​String> adapterSql)
      Sets a map db adapter specific SQL statements for 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 single prefetch path with semantics to this query.
      Since:
      4.1
    • removePrefetch

      public void removePrefetch​(String prefetchPath)
      Removes single prefetch path from this query.
      Since:
      4.1
    • buildQuery

      public SQLTemplate 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