IRdsBaseBinding.InUniqueKey

Fore Syntax

InUniqueKey: Boolean;

Fore.NET Syntax

InUniqueKey: boolean;

Description

The InUniqueKey property determines whether key binding is used.

Comments

Available values:

The property is used to set up import of MDM dictionaries. MDM dictionary is imported without key binding.

Fore Example

Executing the example requires that repository contains a table with the T_BINDING identifier and folder with the F_RDS_BINDING identifier. Table must contain the NAME and EDUCATION string fields.

Add links to the Dal, Db, Metabase, Rds system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
    RdsLoader: IMetaRdsLoader;
    Bindings: IRdsLoaderBindings;
    PredBinding: IRdsPredefinedBinding;
    Binding: IRdsUserAttributeBinding;
Begin
    // Get current repository
    MB := MetabaseClass.Active;
    // Create object to create table MDM dictionary and to load data to it
    RdsLoader := New MetaRdsLoader.Create;
    // Determine table which is a data source
    RdsLoader.TableSource := MB.ItemById("T_BINDING").Bind As ITable;
    // Determine table field and created table dictionary bindings
    Bindings := RdsLoader.Bindings;
    // Determine the Name attribute binding
    PredBinding := Bindings.NameBinding;
    PredBinding.Field := "NAME";
    // Determine that key binding is used
    PredBinding.InUniqueKey := True;
    // Add binding for custom attribute
    Binding := Bindings.Add(RdsLoaderBindingType.UserAttribute) As IRdsUserAttributeBinding;
    Binding.Field := "EDUCATION";
    // Determine that attribute created in the MDM dictionary will have the Long Text type
    Binding.DataDomain := DbDataDomain.Memo;
    // Determine information about created dictionary
    CrInfo := MB.CreateCreateInfo;
    CrInfo.Parent := MB.ItemById("F_RDS_BINDING");
    CrInfo.Id := MB.GenerateId("DICT"0);
    // Determine data base used to create MDM dictionary
    RdsLoader.Database := RdsLoader.TableSource.Database;
    // Create a dictionary
    (RdsLoader.CreateObject(CrInfo) As IMetabaseObject).Save;
    // Load data
    RdsLoader.Load(UpdateLoadMode.Insert);
End Sub UserProc;

After executing the example, table dictionary with the DICT identifier used to load data from the T_BINDING table is created in the F_RDS_BINDING folder.

Fore.NET Example

The requirements and result of the Fore.NET Example execution match with those in the Fore Example.

Imports Prognoz.Platform.Interop.Dal;
Imports Prognoz.Platform.Interop.Db;
Imports Prognoz.Platform.Interop.Rds;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
    RdsLoader: IMetaRdsLoader;
    Bindings: IRdsLoaderBindings;
    PredBinding: IRdsPredefinedBinding;
    Binding: IRdsUserAttributeBinding;
Begin
    // Get current repository
    MB := Params.Metabase;
    // Create object to create table MDM dictionary and to load data to it
    RdsLoader := New MetaRdsLoader.Create();
    // Determine table which is a data source
    RdsLoader.TableSource := MB.ItemById["T_BINDING"].Bind() As ITable;
    // Determine table field and created table dictionary bindings
    Bindings := RdsLoader.Bindings;
    // Determine the Name attribute binding
    PredBinding := Bindings.NameBinding;
    PredBinding.Field := "NAME";
    // Determine that key binding is used
    PredBinding.InUniqueKey := True;
    // Add binding for custom attribute
    Binding := Bindings.Add(RdsLoaderBindingType.rlbtUserAttribute) As IRdsUserAttributeBinding;
    Binding.Field := "EDUCATION";
    // Determine that attribute created in the MDM dictionary will have the Long Text type
    Binding.DataDomain := DbDataDomain.dddMemo;
    // Determine information about created dictionary
    CrInfo := MB.CreateCreateInfo();
    CrInfo.Parent := MB.ItemById["F_RDS_BINDING"];
    CrInfo.Id := MB.GenerateId("DICT"0);
    // Determine data base used to create MDM dictionary
    RdsLoader.Database := RdsLoader.TableSource.Database;
    // Create a dictionary
    (RdsLoader.CreateObject(CrInfo) As IMetabaseObject).Save();
    // Load data
    RdsLoader.Load(UpdateLoadMode.ulmInsert);
End Sub;

See also:

IRdsBaseBinding