Modeling a Query Model Class
Prerequisites
You have created a query or a composite model class in the Mobile Project.
Context
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.
Procedure
-
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
-
Choose

The Select Model Class dialog box appears.
-
Select the required model class and choose Finish.
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.
DISTINCT
Select this option to retrieve only unique rows in the query result set.
This option is disabled by default.
-
-
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
Enter alias names for the required model classes.
Syntax: Model Class Alias
Example: ORDER$ROOT order
Add join conditions for relations
Button to generate the join conditions
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.

