JoinAttributeName: String;
JoinAttributeName: string;
The JoinAttributeName property determines identifier of a joined attribute.
The property is used if IOrmCondition.Operator_ is set to the following values:
Executing the example requires that the repository contains a time series database with the TSDB identifier. This database should contain integer attributes of time series with the identifiers COUNTRY, PERFORMANCE, TARGET.
Add links to the Cubes, Metabase, Orm, and Rds system assemblies.
Sub UserCond;
Var
MB: IMetabase;
RubDesc: IMetabaseObjectDescriptor;
RubrIn: IRubricatorInstance;
DictInst: IMetaDictionaryInstance;
MetaDLookup: IMetaDictionaryLookup;
Conditions: IOrmConditions;
Cond: IOrmCondition;
Current: IMetaDictionaryData;
Begin
// Get time series database
MB := MetabaseClass.Active;
RubDesc := MB.ItemById("TSDB");
RubrIn := RubDesc.Open(Null) As IRubricatorInstance;
// Get time series dictionary
DictInst := RubrIn.Facts;
// Create an object that is used to search in the dictionary
MetaDLookup := DictInst.CreateLookup("");
// Set search conditions
Conditions := MetaDLookup.Where;
// Condition 1: value of attribute COUNTRY=512
Cond := Conditions.Add;
Cond.AttributeName := "COUNTRY";
Cond.Value := 512;
// Condition 2 (nested): PERFORMANCE attribute value
// should be greater than value of the TARGET attribute
Cond := Conditions.Add;
Cond.Operator_ := OrmComparisonOperator.Conditions;
Conditions := Cond.Nested;
Cond := Conditions.Add;
Cond.AttributeName := "PERFORMANCE";
Cond.Operator_ := OrmComparisonOperator.JoinGreater;
Cond.JoinAttributeName := "TARGET";
// Search and display search results in the console window
MetaDLookup.Open(DictionaryCursorOptions.None);
While Not MetaDLookup.Eof Do
Current := MetaDLookup.Current;
Debug.WriteLine(Current.Record.Key.ToString);
MetaDLookup.Next;
End While;
MetaDLookup.Close;
End Sub UserCond;
After executing the example the console window displays time series keys corresponding to the conditions: the COUNTRY attribute value equals to 512, the PERFORMANCE attribute value is greater than the TARGET attribute value.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Orm;
Imports Prognoz.Platform.Interop.Rds;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
RubDesc: IMetabaseObjectDescriptor;
RubrIn: IRubricatorInstance;
DictInst: IMetaDictionaryInstance;
MetaDLookup: IMetaDictionaryLookup;
Conditions: IOrmConditions;
Cond: IOrmCondition;
Current: IMetaDictionaryData;
Begin
// Get time series database
MB := Params.Metabase;
RubDesc := MB.ItemById["TSDB"];
RubrIn := RubDesc.Open(Null) As IRubricatorInstance;
// Get time series dictionary
DictInst := RubrIn.Facts;
// Create an object that is used to search in the dictionary
MetaDLookup := DictInst.CreateLookup("");
// Set search conditions
Conditions := MetaDLookup.Where;
// Condition 1: value of attribute COUNTRY=512
Cond := Conditions.Add();
Cond.AttributeName := "COUNTRY";
Cond.Value := 512;
// Condition 2 (nested): PERFORMANCE attribute value
// should be greater than value of the TARGET attribute
Cond := Conditions.Add();
Cond.Operator := OrmComparisonOperator.ocoConditions;
Conditions := Cond.Nested;
Cond := Conditions.Add();
Cond.AttributeName := "PERFORMANCE";
Cond.Operator := OrmComparisonOperator.ocoJoinGreater;
Cond.JoinAttributeName := "TARGET";
// Search and display search results in the console window
MetaDLookup.Open(DictionaryCursorOptions.dcuoNone);
While Not MetaDLookup.Eof() Do
Current := MetaDLookup.Current;
System.Diagnostics.Debug.WriteLine(Current.Record.Key.ToString());
MetaDLookup.Next();
End While;
MetaDLookup.Close();
End Sub;
See also: