KeepNativeNames: Boolean;
KeepNativeNames: boolean;
The KeepNativeNames property determines whether object physical name is saved on its update.
Available values:
True. Object physical name is saved on its update.
False. Object physical name is not saved on its update. Default value.
Executing the example requires that repository contains MDM dictionary with the RDS identifier.
Add links to the Metabase, Rds system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
rds: IMetabaseObjectDescriptor;
metaDict: IMetaDictionary;
Attrs: IMetaAttributes;
Obj: IMetabaseObjectDescriptor;
Upd: IMetabaseUpdate;
Nd: IMetabaseUpdateObjectNode;
RootFolder: IMetabaseUpdateFolderNode;
NdFol: IMetabaseUpdateFolderNode;
Begin
// Get repository
Mb := MetabaseClass.Active;
// Get MDM dictionary
rds := mb.ItemById("RDS");
metaDict := rds.Bind As IMetaDictionary;
// Get dictionary attributes
Attrs := metaDict.Attributes;
// Determine table name use on updating repository
Attrs.KeepTableNativeNameOnMetabaseUpdate := True;
// Create an update object
Upd := Mb.CreateUpdate;
// Create an update structure object
RootFolder := Upd.RootFolder;
// Get MDM dictionary table
Obj := Mb.ItemById("RDS").Children.Item(0).Edit;
// Rename table
Obj.Name := "123Table";
// Add table the update structure
Nd := RootFolder.Add(MetabaseUpdateNodeType.Object) As IMetabaseUpdateObjectNode;
Nd.Object := Obj;
// Save physical table name on update
Nd.KeepNativeNames := True;
// Add MDM dictionary to the update structure
Nd := RootFolder.Add(MetabaseUpdateNodeType.Object) As IMetabaseUpdateObjectNode;
Nd.Object := rds;
NdFol := (Nd As IMetabaseUpdateFolderNode);
// Save update to the file
Upd.SaveToFileNF("C:\Update.pefx");
End Sub UserProc;
Imports Prognoz.Platform.Interop.Rds;
…
Public Shared Sub Main(Params: StartParams);
Var
Mb: IMetabase;
rds: IMetabaseObjectDescriptor;
metaDict: IMetaDictionary;
Attrs: IMetaAttributes;
Obj: IMetabaseObjectDescriptor;
Upd: IMetabaseUpdate;
Nd: IMetabaseUpdateObjectNode;
RootFolder: IMetabaseUpdateFolderNode;
NdFol: IMetabaseUpdateFolderNode;
Begin
// Get repository
Mb := Params.Metabase;
// Get MDM dictionary
rds := mb.ItemById["RDS"];
metaDict := rds.Bind() As IMetaDictionary;
// Get dictionary attributes
Attrs := metaDict.Attributes;
// Determine table name use on updating repository
Attrs.KeepTableNativeNameOnMetabaseUpdate := True;
// Create an update object
Upd := Mb.CreateUpdate();
// Create an update structure object
RootFolder := Upd.RootFolder;
// Get MDM dictionary table
Obj := Mb.ItemById["RDS"].Children.Item[0].Edit();
// Rename table
Obj.Name := "123Table";
// Add table the update structure
Nd := RootFolder.Add(MetabaseUpdateNodeType.untObject) As IMetabaseUpdateObjectNode;
Nd.Object := Obj;
// Save physical table name on update
Nd.KeepNativeNames := True;
// Add MDM dictionary to the update structure
Nd := RootFolder.Add(MetabaseUpdateNodeType.untObject) As IMetabaseUpdateObjectNode;
Nd.Object := rds;
NdFol := (Nd As IMetabaseUpdateFolderNode);
// Save update to the file
Upd.SaveToFileNF("C:\" + "Update.pefx");
End Sub;
After executing the example, the update will be created. Physical name of table is modified and will be saved on update.
See also: