Attrs: IOrmSimpleAttrs;
The Attrs property returns collection of object attributes.
Use the IOrmSimpleAttrs.Item property to get attribute from the collection.
Executing the example requires that the repository contains a simple class object with the DICT identifier. Add links to the Dal, Metabase, Orm and Rds system assemblies.
Sub UserProc;
Var
MB: IMetabase;
RdsDict: IRdsDictionary;
RdsDictInst: IRdsDictionaryInstance;
OrmClass: IOrmSimpleClass;
sAtts: IOrmSimpleAttrs;
Attr: IOrmSimpleAttr;
i: Integer;
s: String;
Begin
MB := MetabaseClass.Active;
RdsDict := MB.ItemById("DICT").Bind As IRdsDictionary;
RdsDictInst := RdsDict.Open(Null);
OrmClass := RdsDict As IOrmSimpleClass;
sAtts := OrmClass.Attrs;
For i := 0 To sAtts.Count - 1 Do
Attr := sAtts.Item(i);
Debug.WriteLine("Attribute:");
Debug.Indent;
Debug.WriteLine("- key: " + Attr.Key.ToString);
Debug.WriteLine("- identifier: " + Attr.Id);
Debug.WriteLine("- name: " + Attr.Name);
Select Case Attr.DataType
Case DbDataType.Blob: s := "binary or character data array";
Case DbDataType.Boolean: s := "logical data";
Case DbDataType.Date: s := "date without time";
Case DbDataType.DateTime: s := "date and time";
Case DbDataType.Float: s := "real values";
Case DbDataType.Integer: s := "integer values";
Case DbDataType.NoData: s := "no data";
Case DbDataType.String: s := "character data";
End Select;
Debug.WriteLine("- data type: " + s);
Debug.Unindent;
End For;
End Sub UserProc;
After executing the example the console window displays information about object attributes.
See also: