The essence this CODB class is storehouse of stored objects - objects whouse structure descript into dictionary.
coDepositioryNew(<sDictID>, <sUser>, <sPasswd>) --> CODBDEPOSITORY object coDepository:New(<sDictID>, <sUser>, <sPasswd>) --> CODBDEPOSITORY object
APPEND | Append object to storehouse. |
CHECKBODY | Checks object a valid class. |
CLOSE | Close opened files. |
CREATE | Create empty depository. |
DELETE | Delete object from storehouse. |
GETVALUE | Get object from storehouse. |
ID4PRIMARYKEY | Returns object identifier. |
IDLIST | Returns object of class IDLIST. |
NEW | Initiation new CODBDEPOSITORY object. |
OPEN | Open all necessary files. |
PADRBODY | Makes data representation. |
SELECT | Returns identifier list of selected objects. |
UPDATE | Update object into storehouse. |
* open first depository from MY001 oDep:=coDepository():new("MY00101") oDep:open() oDict:=oDep:dictionary() * get currency metadata currBody:=oDict:classBodyByName("currency") if empty(currBody) ? "Class 'currency' not found in dictionary" quit endif *this data may be load from txt or dbf source file data:={; {"USD","USA dollar"},; {"UUU","UUU dollar"},; {"RUR","Russian rubl"},; {"RUA","Ukraina rubl :)"}; } * add currency objects for i=1 to len(data) obj:=map() obj:code := data[i][1] obj:name := data[i][2] obj_id := oDep:id4primaryKey("currency","code",obj:code) if empty(obj_id) oDep:append(obj,currBody:id) else /* object exist in depository */ obj:id := obj_id oDep:update(obj) endif if !empty(oDep:error) ? "Error:",oDep:error else ? "currency object '"+obj:code+"' added to depository" endif next ? "To depository added ",len(data)," objects" c_list:=oDep:select(currBody:id,,,'code="U"') ? "Select currency objects with code='U':",c_list c_list:=oDep:select(currBody:id) ? "Select all currency objects:",c_list ? "Loading objects body:" for i=1 to len(c_list) obj:=oDep:getValue(c_list[i]) ? "code=",obj:code, "name=",obj:name next
No dependies of platform.
Append object to storehouse.
Append(<oData>, <sClassID>) --> <sDataID>
Returns <sDataID> - identifier registered object.
Append() appends new object <oData> to storehouse as object of class <sClassID> and returns objects identifier <sDataID>.
<::Error> contain error descriptions if araised.
Checks object a valid class.
CheckBody(<oData>, <sClassID>) --> <oData>
Returns object <oData>.
CheckBody() checks object <oData> a valid class <sClassID>. If object is a valid, CheckBody() fills <oData> properties the default values if necessary.
<::Error> contain error descriptions if araised.
Close opened files.
Close() --> TRUE || FALSE
No arguments
Returns TRUE if files closed.
Close() is close files or connection with SQL server.
Create empty depository.
Create() --> TRUE || FALSE
No arguments
Returns TRUE if new empty depository created.
Create() returns TRUE if new empty depository created. Usualy, this method do not needy to direct invitation. It's call automaticaly when new depository appending to CODBDICTIONARY.
<::Error> contain error descriptions if araised.
Delete object from storehouse.
Delete(<sDataID>) --> TRUE || FALSE
Returns TRUE if object was deleted.
Delete() deletes object with identifier <sDataID> from depository.
<::Error> contain error descriptions if araised.
Get object from storehouse.
GetValue(<sDataID>) --> <oData>
Returns object <oData> with identifier <sDataID>.
GetValue() gets form depository and returns object <oData> with identifier <sDataID>.
<::Error> contain error descriptions if araised.
Returns object identifier.
Id4PrimaryKey(<sClassName>, <sKeyName>, <KeyValue>) --> <sDataID>
Returns <sDataID> - identifier of founded object.
Id4ProperyKey() returns <sDataID> - identifier of founded object whouse properties with name <sKeyName> is equal <KeyValue>.
Returns object of class IDLIST.
IdList(<sClassID>[, <nOrder>][, <sName>][, <sWhere>]) --> <oIDList>
Returns <oIDList> - object of class IDLIST.
IdList() returns <oIDList> - object of class CODBIDLIST.
Initiation new CODBDEPOSITORY object.
New(<sDepID>, <sUser>, <sPasswd>) --> CODBDEPOSITORY object
Method returns new CODBDEPOSITORY object.
New() inits new CODBDEPOSITORY object and returns it.
If object <sDepID> already exist, New() openes and returns this ddepository.
Open all necessary files.
Open() --> TRUE || FALSE
No arguments
Returns TRUE if files opened.
Open() openes all necessary files or openes connection with SQL server.
<::Error> contain error descriptions if araised.
Makes data representation.
PadrBody(<oData>, <sClassID>) --> <oData>
Returns object <oData>.
PadrBody() makes data representation for <oData> to class <sClassID>.
<::Error> contain error descriptions if araised.
Returns identifier list of selected objects.
Select(<sClassID>[, <nOrder>][, <sName>][, <sWhere>]) --> <aIdent>
Returns <aIdent> array of object identifier what equal searching condition.
Select() returns for class <sClassID> identifier list <aIdent> selected objects in order <nOrder> whose attribute <Name> == <sName> and attributes equal <sWhere>.
<::Error> contain error descriptions if araised.
Update object into storehouse.
Update(<oData>) --> TRUE || FALSE
Returns TRUE if object updated.
Update() updates object <oData> into storehouse. If depositoy have not object with identifier <oData:ID>, Update() returns FALSE.
<::Error> contain error descriptions if araised.