!--a11y-->
Business Query 
A business query is a component that retrieves a set of records based on user input.
You can use it to retrieve business object records of a particular type, which match a given criteria. The resultant records are retrieved as a business collection. The values for the search criteria are modeled as attributes of the business query object. The attribute values of the object act as filter parameters for the corresponding business object attributes. These attributes may or may not be bound to the user interface.
The structure of a business query is similar to a business object. However a business query is used only to perform queries.
Each query returns a recordset in the form of a business collection or a list engine object. If the return type is a business collection, it will create the business collection, fill it and return the object. You can use the methods provided in these objects to perform any further operations.
Similar to a business object, the business query as defined by the business framework is a generic class that can be directly instantiated. You must first add specific attributes and methods. The attributes share the same characteristics of business object attributes, but instead of being mapped to segment fields in the business document, they are mapped to the selection parameters of the query business document. You can map the query business document to the business query using MAS. The business document is available at runtime as part of business query meta-information in the Mobile Application Repository.
When a query is called at runtime, the attribute values of the business query are passed to the mapped query business document parameters (via the mapping specified in MAS). The parameters in turn are used in the WHERE clauses of the business documents for getting the required records.
The business document in the repository defines how each parameter is logically compared to the mapped business object attribute (equals, like, less than, greater than, etc.) and how these parameter expressions relate to each other (logical and, or). The business document layer combines the attribute values and the parameters as specified in the business document repository to form a SQL WHERE clause for the actual selection.
One of the following match types can be defined in MAS, for each attribute of the business query:
|
Match Type |
Description |
|
Exact match |
If a business collection is retrieved: The attribute value of the business query has to be an exact match of the specified attribute value of all business objects in the collection. If a list engine is retrieved: The attribute value of the business query has to match one of the segment field values for all records in the TL recordset of the list engine. If the business query attribute value is not specified, it is not used as the search criteria. |
|
Match At Begin |
If a business collection is retrieved: The attribute value of the business query has to match the initial characters of the specified attribute value of all the business objects in the business collection. If a list engine is retrieved: The attribute value of the business query has to match of one of the segment field values for all records in the TL recordset of the list engine. If the business query attribute value is not specified, it is not used as the search criteria. |
|
Match Exact Empty |
Similar to the match type “Exact Match”, with the exception that empty values are taken as the search criteria. |
|
Match At End |
If a business collection is retrieved: The attribute value of the business query has to match the last few characters of the attribute value of all the business objects in the business collection. If a list engine is being retrieved: The attribute value of the business query has to match of one of the segment field values for all records in the TL recordset of the list engine. If the business query attribute value is not specified, it is not used as the search criteria. |
|
Match Sub String |
If a business collection is being retrieved: The attribute value of the business query will be a substring of the attribute value of all the business objects in the business collection. If a list engine is being retrieved: The attribute value of the business query will be a substring of one of the segment field values for all the records in the TL recordset of the list engine. If the business query attribute value is not specified, it is not used as the search criteria. |
|
Match Advanced |
This is a combination of the other search types. In addition, there is a provision for specifying the number of characters. For example, if you enter *jo??, the business query will perform a search for any record containing ‘jo’ followed by any two characters. |
See also: