Set a table as loosely coupled table
Check if there are loosely coupled tables in the app by using the GetLooselyCoupledVector method.
Set a table as loose using the SetLooselyCoupledVector method.
Examples
Example 1:
The data model in the app is the following:
The client sends:
The engine returns:
There is no loosely-coupled tables.
Example 2:
1. Create a folder connection using the CreateConnection method.
The client sends:
The engine returns:
The folder connection is created. The identifier of the connection (in qConnectionId) is produced by the engine and is unique.
2. Load the tables CitizenCity, CitizenSchool and SchoolCity into the app using the SetScript method.
The client sends:
The engine returns:
The script has been updated with the new values. The three tables are created.
3. Reload the app.
The client sends:
The engine returns:
The app is reloaded.
The data model is as follows:
4. Check if some tables are loose using the GetLooselyCoupledVector method.
The client sends:
The engine returns:
The first loaded table (the table CitizenCity) is loose. The associated flag is set to 2.
5. Set loose the table SchoolCity using the script statement Loosen table.
The client sends:
The engine returns:
The table SchoolCity is loose.
6. Reload the app.
The client sends:
The engine returns:
The app is reloaded.
The data model is as follows:
7. Check that the third table is loose using the GetLooselyCoupledVector method.
The client sends:
The engine returns:
The third loaded table (the table SchoolCity) is loose. The associated flag is set to 2. The table CitizenCity is no longer loose.
8. Set loose the table CitizenSchool (with flag 1) using the SetLooselyCoupledVector method. CitizenSchool is the second loaded table.
The client sends:
The engine returns:
The tables CitizenSchool and SchoolCity are loose.
9. Check that the tables CitizenSchool and SchoolCity are loose, using the GetLooselyCoupledVector method.
The client sends:
The engine returns:
The table CitizenSchool is loose (flag set to 1) and the table SchoolCity is always loose (flag set 2).
10. Set loose the table CitizenCity (with flag 1) using the SetLooselyCoupledVector method. CitizenCity is the first loaded table. The table CitizenSchool should not be loose any longer (flag set to 0).
The client sends:
The engine returns:
The tables CitizenCity and SchoolCity are loose.
11. Check that the tables CitizenCity and SchoolCity are loose, using the GetLooselyCoupledVector method.
The client sends:
The engine returns:
The table CitizenCity is loose (flag set to 1) and the table SchoolCity is always loose (flag set 2). The table CitizenSchool is no longer loose.
12. Check that the table SchoolCity cannot be unloose.
The client sends:
The engine returns:
The table SchoolCity could not be unloose because it has 2 as flag.