FactDev  0.1
Databases::Database Class Reference

The Database class Master class for all database access. More...

#include <database.h>

Inheritance diagram for Databases::Database:
Databases::BillingDatabase Databases::ContributoryDatabase Databases::CustomerDatabase Databases::ProjectDatabase Databases::RateDatabase Databases::UserDatabase

Public Member Functions

QString lastError (const QSqlQuery &q) const
 Database::lastError Return an error message on the last error occured during the SQL request q More...
 
void testCases ()
 Database::testCases Realise a test cases.
 
void executeFile (QString pName)
 Database::executerFichier Exeute a specified file named pName More...
 
void openTransaction ()
 Database::openTransaction Open new transaction.
 
void closeTransaction ()
 Database::closeTransaction Close current transaction.
 
void close ()
 Database::close Close database access.
 
void open ()
 Database::open Open database.
 
 ~Database ()
 Database::~Database Suppression object, and close database access.
 
void setDatabase (QSqlDatabase sql)
 Database::setDatabase Set database. More...
 
void updateBillingNumber ()
 Database::updateBillingNumber Update the billing number.
 
void cleanDatabase ()
 Database::clearDatabase Drop alls tables of Database WARNING: We can't restore data after.
 
void changeDatabase (Databases::DbType dbType)
 changeDatabase Change the current database : mysql to sqlite or sqlite to mysql More...
 

Static Public Member Functions

static Databaseinstance (bool tests=false) throw (DbException*)
 Database::getInstance Return an instance of Database. More...
 

Protected Member Functions

 Database (bool tests=false) throw (DbException*)
 Database::Database Database is a singleton.
 
QVariant value (const QSqlQuery &q, const QString &champ) const
 Database::valeur Value of database field. More...
 

Protected Attributes

QSettings * _settings
 settings
 
QSqlDatabase mDatabase
 contains Database
 
QList< Database * > _instances
 List of instances.
 

Static Protected Attributes

static Database_instance = 0
 Instance.
 
static bool _dbInstance = 0
 an instance of db is open
 
static bool isOpen = false
 Database is open.
 
static bool _isMysql = false
 

Detailed Description

The Database class Master class for all database access.

Author
Antoine de Roquemaurel

Member Function Documentation

void Databases::Database::changeDatabase ( Databases::DbType  dbType)

changeDatabase Change the current database : mysql to sqlite or sqlite to mysql

Parameters
dbType: The new database type, Sqlite or Mysql
void Databases::Database::executeFile ( QString  pName)

Database::executerFichier Exeute a specified file named pName

Parameters
pNomFile name
Database * Databases::Database::instance ( bool  tests = false)
throw (DbException *
)
static

Database::getInstance Return an instance of Database.

Returns
Instance of Database
QString Databases::Database::lastError ( const QSqlQuery &  q) const
inline

Database::lastError Return an error message on the last error occured during the SQL request q

Parameters
qSQL request
Returns
an error message
void Databases::Database::setDatabase ( QSqlDatabase  sql)

Database::setDatabase Set database.

Parameters
sqlThe new database
QVariant Databases::Database::value ( const QSqlQuery &  q,
const QString &  champ 
) const
protected

Database::valeur Value of database field.

Parameters
qQuery
champField
Returns
The value

The documentation for this class was generated from the following files: