Metadata it is objects what describe other object and so objects needdes to control of ODB kernel.
Any metadata have obligatory attribute <ID>. This attribute use for access to keeping objects. <ID> created ODB kernel when object append to dictionary.
The metadata counts and names are limited and determine by ODB kernel. The dictionary have object only classes:
DEPOSIT EXTENT ATTR COUNTER INDEX CLASS TCOLUMN TVIEW REPORT PLUGINS USER GROUP
In the dictionary mast be at least one object of each metaclass.
Attributes:
ID - metadata identifier
NAME - depository name
Example: create DEPOSIT metadata
oDict := coDictionary():new("MY001") oDict:open() .... depBody := map() depBody:name := "depository for Russian global information" ... dep_id := oDict:append(depBody,"DEPOSIT") if !empty(oDict:error) ? "Error:",oDict:error endif
Attributes:
ID - metadata identifier
NAME - extent name
HELP - description
Example: create EXTENT metadata
extBody := map() extBody:name := "statedep" extBody:help := "information from state department of statistic" ... ext_id := oDict:append(extBody,"EXTENT") ....
Attributes:
ID - metadata identifier
NAME - keeping object attribute name
TYPE - keeping object attribute type
LEN - length
DEC - characters after point (for numeric attributes)
LENTYPE - formatting type (for string attributes)
REF_TO - class identifier (for attributes with type "R") if empty, then reference to object any classes
DEFVALUE - the value by default
The TYPE values:
"C" - characters string with limit by length
"N" - numeric
"D" - date
"L" - logical
"M" - characters string without limit by length
"O" - object
"X" - any data of simple type: string, numeric, date, logical, reference
"R" - reference to object
"S" - reference to class
"A" - array of reference
"B" - code block
The LENTYPE values:
1 - "As is"
2 - "Right trim"
3 - "Right & Left trim"
4 - "Right pad length"
Example: create ATTR metadata
attr:=map() attr:name := "code" attr:type := "C" attr:len := 7 attr:lentype := 3 .... code_id := oDict:append(attr,"ATTR") .... attr:=map() attr:name := "name" attr:type := "C" attr:len := 20 attr:lentype := 2 .... name_id := oDict:append(attr,"ATTR")
Attributes:
Attributes:
ID - metadata identifier
NAME - index name
EXPR - index expression
Example: create INDEX metadata
indBody := map() indBody:name := "code" indBody:expr := "code" ind1_id := oDict:append(indBody,"INDEX") .... indBody := map() indBody:name := "name" indBody:expr := "name" ind2_id := oDict:append(indBody,"INDEX") ....
Attributes:
ID - metadata identifier
NAME - keeling object name
SUPER_ID - super class identifier
EXTENT_ID - extent identifier
EXPR_ESSENCE - expression for short appeares
UNSTABLE - the characteristic of object stably (service parameter)
ATTR_LIST - array of attribute identifiers
IDX_LIST - array of index identifiers
Example: create CLASS metadata
classBody:=map() /* information about coding world currencies */ classBody:name := "currency" /* from state department of statistic */ classBody:extent_id := ext_id /* return via "USD:USA dollar" */ classBody:expr_essence := "code+':'+name" /* two attributes "code" and "name" */ classBody:attr_list := {code_id,name_id} /* two index "code" and "name" */ classBody:idx_list := {ind1_id,ind2_id} currency_id := oDict:append(classBody,"CLASS") if !empty(oDict:error) ? "Error:",oDict:error endif
Attributes:
Attributes:
Attributes:
Attributes:
Attributes: