How to Export the Domain Model
Let's suppose we are working on the "CRM" back-end project in which we already have a Domain Model where we defined the "Company" class. Once you add the database connection, you are ready to make the synchronization.
Notice that each element of the "Company" class has a question mark on its icon. This icon means that there is no element in the connected database attached to the current one.
Let's use the synchronization process to export the "Company" class in the connected database. Once the database connection is ready, let's use the Synchronization to export the "Company" class. We want eventually to create the "company" table on the physical database.
Right-click on the "CRM" database node and select the "Synchronize" option. In the "Database Synchronizer" dialog, expand the "Classes" node.
As you can notice, the unmapped elements are marked with a grey right arrow. Right-click on the "Company" Class item and select the "Export to Database" option, then press the "Next" button.
WebRatio Mobile Platform automatically generates the SQL code necessary to create the company table with all the related columns. You can choose among 3 options to handle the generated code: "Save and Execute", "Execute Only" and "Save only" option. If you choose the "Save and Execute" or the "Save Only" option, an SQL script file will be stored in the "DB Script" folder of the Project. Press the "Finish" button to complete the procedure.
Once the Synchronization process is completed, you can see that all the question marks have been removed. This means that the "Company" class is properly mapped to the "company" table in the physical database.