Show TOC

Node Attribute Queries and Custom QueriesLocate this document in the navigation structure

Node Attribute Queries

A node attribute query is a type of query where the search parameters are equal to the assigned node of the query. The search criteria can consist of value comparisons and value ranges on the attributes of the nodes. The query returns the instances of the assigned node whose attributes match the search parameters that have been handed over.

Node attribute queries are recommended for all cases that do not need complex query logic. In contrast to custom queries, node attribute queries are only modeled and therefore do not have to be implemented.

Note
  • The query data type corresponds to the combined structure of the assigned node. Thus the search criteria are always reduced to the attributes of the assigned node.

  • The query returns only instance data or keys of node instances corresponding to the node the query is assigned to.

  • The query returns the node instances that contain the attribute values that match the search criteria.

Example

The SELECT_INVOICE query is assigned to the ROOT node of the CUSTOMER_INVOICE business object. The consumer can search invoices using the attributes of the ROOT node, for example the INVOICE_NUMBER 48775444 or the CREATION_DATE 2009-04-12.

Custom Queries

A custom query executes application-specific logic. In contrast to the node attribute query, this logic must be implemented in the implementing class of the query. The custom query can contain any data type structure that is handed over by the consumer to the query implementation at runtime. Usually, a query of this type returns node data types. In addition, the query implementation can return any data table as the result of the query. The result data table must contain a key component related to the instances of the node the query is assigned to.

Custom queries must be used if the recommended node attribute queries do not fulfill the requirements. This is the case if specific query parameters must be handed over or if the query logic is more complex than comparing attribute values.

Note

The query returns instance data or keys of the node instances of its assigned node, or any data table that is defined as result table of the query.

Example

You can search in the CUSTOMER_INVOICE business object for expired dates using the GET_EXPIRED_INVOICES query that is assigned to the ROOT node.