PriorDataLinkDependentsClear: Boolean;
PriorDataLinkDependentsClear: boolean;
The PriorDataLinkDependentsClear property determines whether objects depending by the content are pre-cleaned.
Available values:
True. Pre-cleaning is used.
False. By default. Pre-cleaning is not used.
Executing the example requires that the repository contains two tables with the TABLE_A and TABLE_B identifiers. One of the fields of the TABLE_A table must be external key of any field of the TABLE_B table.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
Update: IMetabaseUpdate;
Root: IMetabaseUpdateFolderNode;
TableObj: IMetabaseUpdateDataObjectNode;
TableAsKeyObj: IMetabaseUpdateDataObjectNode;
Begin
// Get repository
MB := MetabaseClass.Active;
// Create an update
Update := MB.CreateUpdate;
// Get object containing update structure
Root := Update.RootFolder;
// Add a table with the TABLE_A identifier to update
TableObj := Root.Add(MetabaseUpdateNodeType.DataObject) As IMetabaseUpdateDataObjectNode;
TableObj.Object := MB.ItemById("TABLE_A");
// Update table data and metadata
TableObj.Method := MetabaseUpdateMethod.All;
// Enable object recreation on update
TableObj.AlterType := MetabaseObjectAlterType.Recreate;
// Add a table with the TABLE_B identifier to update
TableAsKeyObj := Root.Add(MetabaseUpdateNodeType.DataObject) As IMetabaseUpdateDataObjectNode;
TableAsKeyObj.Object := MB.ItemById("TABLE_B");
// Update table data and metadata
TableAsKeyObj.Method := MetabaseUpdateMethod.All;
// Sort added objects
Root.Sort(UpdateSortMode.ByDepends);
// Enable object recreation on update
TableAsKeyObj.AlterType := MetabaseObjectAlterType.Recreate;
// Select the Recreate Tables checkbox
Update.AlterType(MetabaseObjectClass.KE_CLASS_TABLE) := MetabaseObjectAlterType.Recreate;
// Apply pre-cleaning of objects depending by the content
Update.PriorDataLinkDependentsClear := True;
// Save update to file
Update.SaveToFileNF("C:\Update.pefx");
End Sub UserProc;
After executing the example the update with set parameters is saved to file by the specified path.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Update: IMetabaseUpdate;
Root: IMetabaseUpdateFolderNode;
TableObj: IMetabaseUpdateDataObjectNode;
TableAsKeyObj: IMetabaseUpdateDataObjectNode;
Begin
// Get repository
MB := Params.Metabase;
// Create an update
Update := MB.CreateUpdate();
// Get object containing update structure
Root := Update.RootFolder;
// Add a table with the TABLE_A identifier to update
TableObj := Root.Add(MetabaseUpdateNodeType.untDataObject) As IMetabaseUpdateDataObjectNode;
TableObj.Object := MB.ItemById["TABLE_A"];
// Update table data and metadata
TableObj.Method := MetabaseUpdateMethod.mumAll;
// Enable object recreation on update
TableObj.AlterType := MetabaseObjectAlterType.meobaltyRecreate;
// Add a table with the TABLE_B identifier to update
TableAsKeyObj := Root.Add(MetabaseUpdateNodeType.untDataObject) As IMetabaseUpdateDataObjectNode;
TableAsKeyObj.Object := MB.ItemById["TABLE_B"];
// Update table data and metadata
TableAsKeyObj.Method := MetabaseUpdateMethod.mumAll;
// Sort added objects
Root.Sort(UpdateSortMode.usmByDepends);
// Enable object recreation on update
TableAsKeyObj.AlterType := MetabaseObjectAlterType.meobaltyRecreate;
// Select the Recreate Tables checkbox
Update.AlterType[(MetabaseObjectClass.KE_CLASS_TABLE).value__] := MetabaseObjectAlterType.meobaltyRecreate;
// Apply pre-cleaning of objects depending by the content
Update.PriorDataLinkDependentsClear := True;
// Save update to file
Update.SaveToFileNF("C:\\Update.pefx");
End Sub;
See also: