Modeling a Query
You model a query that you have created by defining the input and output parameters, adding joins, filters, and sorting criteria, depending on your requirements.
You have created a query service.
More information: Creating a Query Service
If your output structure is not equivalent to a client data object node (for example, because you are performing a join on client data object nodes), you need to create a data structure containing those fields that you require in the output structure.
More information: Creating Data Structures
In th...
1. In the Service editor, select the service you want to model and choose Edit.
2. Select tab page Operations and choose Add to add a new service operation.
3. In the next dialog box, select Query, enter a Name (mandatory) and a Description (recommended) for the query operation, and choose Next.
4. Select the input parameters under Add Input (optional).
a. In the Base Types dialog box, Add the name of the parameter.
b. Enter the type of the parameter.
c. Select Bidirectional or Distinct if necessary.
More information: Query language Reference
d. Continue with this step, until you have defined all the input parameters you need for your query.
5. Select the output parameters under Add Output (mandatory), choose a client data object node or data structure in the list as the return structure of your query.
The query will return a collection of this type.
You can also use drag and drop from the data types area to the left of the dialog box to select the output structure.
6. Add any joins you require under Add Joins (optional).

It is currently only possible to define inner joins since only these are supported by the database at runtime.
7. Add any filters you require under Add Filters (optional).
By default, any new filter is combined with the existing filters through an AND condition. By clicking on AND, you can change the condition to OR and back to AND.
8. Add any sorting conditions you require under add Sorting.
Sort criteria on any attribute of the output structure can be set as either ascending or descending.
More information: Query language Reference