Adichatz generates brute queries to fetch data from Application server or database (by default, one query per entity).\\
For example, the query for a Customer class is described by an XML file called $projectDirectory/resources/xml/model/customer/CustomerQUERYGENERATED.axml:
\\
Remarks:\\
The query description contains 2 parts:\\
* Jointures part describes other entities linked to each rows fetched by the query.
* The QueryPreference part describes the default attributes managed in the outline panel of a Query Editor. Here, only optional query parameters are listed.
\\ \\
Complete query by changing XML elements:\\
Now, we want to complete the query in two ways:
- Add jointures to fetch the staff of the store and the address with the city and the country of the store.
- Add a preference to select only Customers from USA (countryId=103) a new pagination, a new column orders and two filters.\\
Queries could be easily changed as shown below:
Explanations:\\
|< 100% 10em - >|
^ Lines 4-5:|@#eff5fb:Fetch city and country of the address of the customer.|
^ Line 9:|@#eff5fb:fetch the staff of the customer.|
^ Lines 10-12:|@#eff5fb:Fetch address, city and country of the store of the customer.|
^ Lines 28-32:|@#eff5fb:Add parameters allowing the user to extend the selection to specified fields.|
^ Line 38:|@#eff5fb:Define a new preference, identified by usa string, column order is changed and chosen Navigation bar is Scale: User can navigates thru pages using a scale control.|
^ Line 40:|@#eff5fb:Pagination start to first element (position 0) and fetch 50 rows per page.|
^ Line 41:|@#eff5fb:select only customer from USA.|
^ Lines 45-46:|@#eff5fb:Add 2 filters: first on column Active, second on column Store. Only first filter is enabled.|
Open [[tutorial:add_navigator_item|Add navigator item]] to see how to create a new item in navigator to call the query with defined preference.\\
Open [[tutorial:change_table|Change table include]] to see how to display data from new jointures in table control.