#include <d_Database.h>
Public Types | |
| typedef oUInt1 | orDatabase |
Public Methods | |
| d_Database () | |
| ~d_Database () | |
| void | open (const char *iName) |
| void | create (d_Project &iProject, const char *iName, const char *iUrl, orDsk iDataStart=dDataStart, orDsk iDataStep=dDataStep, orDsk iRefStart=dRefStart, orDsk iRefStep=dRefStep) |
| void | close () |
| void | set_object_name (const d_Ref_Any &iObj, const char *iName) |
| void | rename_object (const char *iOldName, const char *iNewName) |
| d_Ref_Any | lookup_object (const char *iName) |
| void | set_retry (int iTimes=30, int iDelay=100) |
| d_String | getName () const |
| d_String | getUrl () const |
| d_Ref< oSysDatabase > | getSchema () const |
| bool | isOpen () const |
| oDomain * | getDomain () const |
| d_Object * | newObject (const char *iClassName) |
| oStorage * | getStorage () const |
A logical database is a container of objects of different classes. A database is contained in a project (d_Project class). Classes inside a database can refer objects in the same database or into the databases of the same Project (federated databases).
MULTI-THREADS: d_Database class is not thread-safe, thus multiple threads cannot share the same istance of d_Database. Instead define one d_Database object per threads. Orient ODBMS will optimize multiple connections to the same database with just one.
DATABASE DEFINITION AND CREATION: To create a database, see Schema Definition in Orient Main Guide document.
LOCATION: d_Database.h
USAGE: d_Database <variable-name>;
WHERE: <variable-name>: is the name of d_Database object
EXAMPLES: d_Database db; * Database object db.open( "business" ); * Open the database
SEE ALSO: d_Project
ODMG: Compliant
|
|
|
|
|
Default Constructor. ODMG : Compliant |
|
|
Destructor. ODMG : Compliant |
|
|
Closes the database open. Any attempt to access a closed database throws d_ErrorDatabaseClosed exception. |
|
||||||||||||||||||||||||||||||||
|
Creates a new database. Creates the database in the project . If a database already exists, throws a d_Error_DatabaseNotCreated exception. |
|
|
Returns the domain of database. If the database is not yet open or created, then 0 is returned. ODMG : Extension |
|
|
Returns the name of database. If the database is not yet open or created, then a empty string is returned (""). ODMG : Extension |
|
|
Returns the schema object (oSysDatabase) of database. This permits to inspect the database schema and to change it at run-time. ODMG : Extension |
|
|
|
|
|
Returns the url of database. If the database is not yet open or created, then a empty string is returned (""). ODMG : Extension |
|
|
Returns true if the database is open, otherwise false. ODMG : Extension |
|
|
Return the named object searched. Search into the database dictionary the object associated with name. If founds, returns a reference to found object, otherwise a null reference. SEE ALSO: d_Dictionary::lookup() ODMG : Compliant |
|
|
|
|
|
Opens the database. Opens the database with read_write access. If a database is already opened throws a d_Error_DatabaseOpen exception. |
|
||||||||||||
|
Rename a named object. Renames an entry in the database dictionary from to . To remove the entry of an object, just call this method passing 0 as second argoument. SEE ALSO: d_Dictionary::bind() ODMG : Compliant |
|
||||||||||||
|
Assign a name to a persistent object. Estabilishes an association between the object and name in the database dictionary. If it's already present an entry with the same name throws d_Error_NameNotUnique exception. It's possible to associate to an object more names. To remove all entries of an object, just call this method passing 0 as second argoument. SEE ALSO: d_Dictionary::bind() ODMG : Compliant |
|
||||||||||||
|
Set the retry values for database open when the database is locked by another application. are the times that Orient will try to open the database, while is the time between a test and another. SEE ALSO: d_Database::open() ODMG : Extension |
|
|
|
1.3-rc1