
You have created a query or a composite model class in the Mobile Project.
On modeling a query model class, the IDE generates the QueryInput and QueryOutput relations for the query. This is displayed them in the Laptop UI Explorer. You can use the input or the result set of the query for context binding in the Mobile Project.
In the Laptop UI Explorer, click the query node with the secondary mouse button and choose Open Query/Composite Model Class Editor.
Choose the Query tab.
Enter details as specified in the table below:
|
Field name |
Description |
User action and values |
|
Input Model Class |
Input object that defines the query input object |
|
|
Result Model Class |
Output object that defines the result set of the query |
- |
|
BI-DIRECTIONAL |
Select this option to allow navigation of the query result set in both directions. This option is enabled by default. Recommendation
We recommend that you select this option to improve performance during the backward movement of the data set. |
|
|
DISTINCT |
Select this option to retrieve only unique rows in the query result set. Note
This applies to the result set of a join query only. This option is disabled by default. |
The IDE allows you to enter aliases, filter conditions, and sort conditions for the query after you specify the Result Model Class .
Enter the conditions for the query, as specified in the table below:
|
Field name |
Description |
User action and values |
|
Alias |
Alias name for a model class Note
You can refer to the alias in the SQL query code to create the filter and the sort conditions. |
Enter alias names for the required model classes. Note
You can use code assist to select the required model classes. Syntax: Model Class Alias Example: ORDER$ROOT order Note
You can enter alias names for multiple model classes, separated by a comma. |
|
Add join conditions for relations |
Button to generate the join conditions |
Note
The IDE enables this button after you specify the Result Model Class . If the query model classes contains model classes that are related, you can choose this button to generate the join conditions (SQL code) for the existing relationships. Choose Add join conditions for relations. The IDE generates the join condition for the query. You can make changes to the join condition and create the filter condition for the query, as required |
|
Conditions |
SQL condition to filter the query result set |
Enter the required condition, for example, order.amount>: amount , where amount is a field in the input class. For information on the Query language operators and parameters, refer to Query Language Reference |
|
Sort Conditions |
Sort order of the query result set |
Enter the sort order for multiple attributes, separated by a comma. The default sort order is ascending. Alternatively, you can select the attribute from the dropdown list. Syntax: Model Class.Attribute Sort Order Example: order.amount descending |
To compile the query, choose
The IDE compiles the query. If an error occurs, the IDE displays an error message and displays the query error text in red. You can make the required changes to the query and repeat this step to recompile.