Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

d_Database Class Reference

#include <d_Database.h>

List of all members.

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< oSysDatabasegetSchema () const
bool isOpen () const
oDomaingetDomain () const
d_ObjectnewObject (const char *iClassName)
oStoragegetStorage () const


Detailed Description

Represents a logical database.

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


Member Typedef Documentation

typedef oUInt1 d_Database::orDatabase
 


Constructor & Destructor Documentation

d_Database::d_Database  
 

Default Constructor.

ODMG : Compliant

d_Database::~d_Database  
 

Destructor.

ODMG : Compliant


Member Function Documentation

void d_Database::close  
 

Closes the database open.

Any attempt to access a closed database throws d_ErrorDatabaseClosed exception.

SEE ALSO: open(), create() ODMG : Compliant

void d_Database::create d_Project   iProject,
const char *    iName,
const char *    iUrl,
orDsk    iDataStart = dDataStart,
orDsk    iDataStep = dDataStep,
orDsk    iRefStart = dRefStart,
orDsk    iRefStep = dRefStep
 

Creates a new database.

Creates the database in the project . If a database already exists, throws a d_Error_DatabaseNotCreated exception.

SEE ALSO: open(), close() ODMG : Extension

oDomain * d_Database::getDomain   const
 

Returns the domain of database.

If the database is not yet open or created, then 0 is returned.

ODMG : Extension

d_String d_Database::getName   const
 

Returns the name of database.

If the database is not yet open or created, then a empty string is returned ("").

ODMG : Extension

d_Ref< oSysDatabase > d_Database::getSchema   const
 

Returns the schema object (oSysDatabase) of database. This permits to inspect the database schema and to change it at run-time.

ODMG : Extension

oStorage * d_Database::getStorage   const [inline]
 

d_String d_Database::getUrl   const
 

Returns the url of database.

If the database is not yet open or created, then a empty string is returned ("").

ODMG : Extension

bool d_Database::isOpen   const [inline]
 

Returns true if the database is open, otherwise false.

ODMG : Extension

d_Ref_Any d_Database::lookup_object const char *    iName
 

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

d_Object * d_Database::newObject const char *    iClassName
 

void d_Database::open const char *    iName
 

Opens the database.

Opens the database with read_write access. If a database is already opened throws a d_Error_DatabaseOpen exception.

SEE ALSO: create(), close() ODMG : Compliant

void d_Database::rename_object const char *    iOldName,
const char *    iNewName
 

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

void d_Database::set_object_name const d_Ref_Any   iObj,
const char *    iName
 

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

void d_Database::set_retry int    iTimes = 30,
int    iDelay = 100
 

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


Friends And Related Function Documentation

friend class oObjectManager [friend]
 


The documentation for this class was generated from the following files:
Generated on Fri Nov 29 17:12:14 2002 for Orient ODBMS Just Edition v. 2.0e by doxygen1.3-rc1