This query is automatically computed to figure out how to retrieve or update data in the database.
The Select query comes from the forward mapping, the Insert, Update and Delete queries come from the reverse mapping. Information contained in the Sources tab, in the Sub-Object Mapping tab and in the Criteria sub-tab are combined in these queries.
If you modify the SQL query, it becomes user-defined and can no longer be automatically calculated, even when you update the mapping. You can see that a statement is user-defined because the User-Defined tool is pressed in the toolbar.
To modify the query, you should modify the expression of the Mapped to column and / or the content of the Criteria sub-tab.
You can recover the computed expression by clicking the User-Defined tool, this will remove any non calculated expression from the tab.
For example, the following SQL queries are automatically computed to figure out how data of class instances are retrieved from or stored into the database:
The Select tab displays a statement that allows to retrieve attribute values of class instances from the database using the class identifying attributes. For example:
select ADDRESS.LINE1 "LINE1", ADDRESS.LINE2 "LINE2", ADDRESS.CITY "CITY", ADDRESS.ZIPCODE "ZIPCODE", ADDRESS.COUNTRY "COUNTRY" from ADDRESS
insert into ADDRESS( ADDRESS.LINE1, ADDRESS.LINE2, ADDRESS.CITY, ADDRESS.ZIPCODE, ADDRESS.COUNTRY) values ( %LINE1%, %LINE2%, %CITY%, %ZIPCODE%, %COUNTRY%)
The Update tab displays a statement that allows you to update attribute values of class instances apart from identifying attributes. For example:
update ADDRESS set ADDRESS.LINE1 = %LINE1%, ADDRESS.LINE2 = %LINE2%, ADDRESS.CITY = %CITY%, ADDRESS.ZIPCODE = %ZIPCODE%, ADDRESS.COUNTRY = %COUNTRY%