QxOrm  1.4.9
C++ Object Relational Mapping library

qx::QxSqlDatabase : define all parameters to connect to database and retrieve a valid connection by thread (this class is a singleton and is thread-safe) More...

#include <QxSqlDatabase.h>

Inheritance diagram for qx::QxSqlDatabase:
qx::QxSingleton< QxSqlDatabase > qx::IxSingleton

List of all members.

Public Types

enum  ph_style { ph_style_question_mark, ph_style_2_point_name, ph_style_at_name }
typedef std::function< void(QSqlDatabase &)> type_fct_db_open

Public Member Functions

QString getDriverName () const
QString getConnectOptions () const
QString getDatabaseName () const
QString getUserName () const
QString getPassword () const
QString getHostName () const
int getPort () const
bool getTraceSqlQuery () const
bool getTraceSqlRecord () const
bool getTraceSqlBoundValues () const
bool getTraceSqlBoundValuesOnError () const
ph_style getSqlPlaceHolderStyle () const
bool getSessionThrowable () const
bool getSessionAutoTransaction () const
bool getValidatorThrowable () const
bool getAutoReplaceSqlAliasIntoQuery () const
bool getVerifyOffsetRelation () const
bool getAddAutoIncrementIdToUpdateQuery () const
bool getForceParentIdToAllChildren () const
type_fct_db_open getFctDatabaseOpen () const
bool getAddSqlSquareBracketsForTableName () const
bool getAddSqlSquareBracketsForColumnName () const
bool getFormatSqlQueryBeforeLogging () const
QStringList getSqlDelimiterForTableName () const
QStringList getSqlDelimiterForColumnName () const
QStringList getSqlDelimiterForTableNameAlias () const
QStringList getSqlDelimiterForColumnNameAlias () const
int getTraceSqlOnlySlowQueriesDatabase () const
int getTraceSqlOnlySlowQueriesTotal () const
bool getDisplayTimerDetails () const
void setDriverName (const QString &s, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setConnectOptions (const QString &s, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setDatabaseName (const QString &s, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setUserName (const QString &s, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setPassword (const QString &s, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setHostName (const QString &s, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setPort (int i, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setTraceSqlQuery (bool b, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setTraceSqlRecord (bool b, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setTraceSqlBoundValues (bool b, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setTraceSqlBoundValuesOnError (bool b, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setSqlPlaceHolderStyle (ph_style e, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setSessionThrowable (bool b, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setSessionAutoTransaction (bool b, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setValidatorThrowable (bool b, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setSqlGenerator (qx::dao::detail::IxSqlGenerator_ptr p, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setAutoReplaceSqlAliasIntoQuery (bool b, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setVerifyOffsetRelation (bool b, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setAddAutoIncrementIdToUpdateQuery (bool b, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setForceParentIdToAllChildren (bool b, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setFctDatabaseOpen (type_fct_db_open fct, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setAddSqlSquareBracketsForTableName (bool b, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setAddSqlSquareBracketsForColumnName (bool b, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setFormatSqlQueryBeforeLogging (bool b, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setSqlDelimiterForTableName (const QStringList &lst, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setSqlDelimiterForColumnName (const QStringList &lst, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setSqlDelimiterForTableNameAlias (const QStringList &lst, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setSqlDelimiterForColumnNameAlias (const QStringList &lst, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setTraceSqlOnlySlowQueriesDatabase (int i, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setTraceSqlOnlySlowQueriesTotal (int i, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
void setDisplayTimerDetails (bool b, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)
qx::dao::detail::IxSqlGeneratorgetSqlGenerator ()
void clearAllSettingsForCurrentThread ()
void clearAllSettingsForDatabase (QSqlDatabase *p)

Static Public Member Functions

static QSqlDatabase getDatabase ()
static QSqlDatabase getDatabase (QSqlError &dbError)
static QSqlDatabase getDatabaseCloned ()
static QSqlDatabase checkDatabaseByThread ()
static void closeAllDatabases ()
static void clearAllDatabases ()
static bool isEmpty ()

Protected Member Functions

bool setCurrentDatabaseByThread (QSqlDatabase *p)
void clearCurrentDatabaseByThread ()

Private Member Functions

 QxSqlDatabase ()
virtual ~QxSqlDatabase ()

Private Attributes

std::unique_ptr
< QxSqlDatabaseImpl > 
m_pImpl
 Private implementation idiom.

Friends

class QxSingleton< QxSqlDatabase >
class qx::dao::detail::IxDao_Helper

Detailed Description

qx::QxSqlDatabase : define all parameters to connect to database and retrieve a valid connection by thread (this class is a singleton and is thread-safe)

Definition at line 75 of file QxSqlDatabase.h.


Member Typedef Documentation

typedef std::function<void (QSqlDatabase &)> qx::QxSqlDatabase::type_fct_db_open

Definition at line 85 of file QxSqlDatabase.h.


Member Enumeration Documentation

Enumerator:
ph_style_question_mark 
ph_style_2_point_name 
ph_style_at_name 

Definition at line 83 of file QxSqlDatabase.h.


Constructor & Destructor Documentation

qx::QxSqlDatabase::QxSqlDatabase ( ) [private]
virtual qx::QxSqlDatabase::~QxSqlDatabase ( ) [private, virtual]

Member Function Documentation

static QSqlDatabase qx::QxSqlDatabase::checkDatabaseByThread ( ) [static]
static void qx::QxSqlDatabase::clearAllDatabases ( ) [static]
void qx::QxSqlDatabase::clearAllSettingsForCurrentThread ( )
void qx::QxSqlDatabase::clearAllSettingsForDatabase ( QSqlDatabase *  p)
void qx::QxSqlDatabase::clearCurrentDatabaseByThread ( ) [protected]
static void qx::QxSqlDatabase::closeAllDatabases ( ) [static]
bool qx::QxSqlDatabase::getAddAutoIncrementIdToUpdateQuery ( ) const
bool qx::QxSqlDatabase::getAddSqlSquareBracketsForColumnName ( ) const
bool qx::QxSqlDatabase::getAddSqlSquareBracketsForTableName ( ) const
bool qx::QxSqlDatabase::getAutoReplaceSqlAliasIntoQuery ( ) const
QString qx::QxSqlDatabase::getConnectOptions ( ) const
static QSqlDatabase qx::QxSqlDatabase::getDatabase ( ) [static]
static QSqlDatabase qx::QxSqlDatabase::getDatabase ( QSqlError &  dbError) [static]
static QSqlDatabase qx::QxSqlDatabase::getDatabaseCloned ( ) [static]
QString qx::QxSqlDatabase::getDatabaseName ( ) const
bool qx::QxSqlDatabase::getDisplayTimerDetails ( ) const
QString qx::QxSqlDatabase::getDriverName ( ) const
type_fct_db_open qx::QxSqlDatabase::getFctDatabaseOpen ( ) const
bool qx::QxSqlDatabase::getForceParentIdToAllChildren ( ) const
bool qx::QxSqlDatabase::getFormatSqlQueryBeforeLogging ( ) const
QString qx::QxSqlDatabase::getHostName ( ) const
QString qx::QxSqlDatabase::getPassword ( ) const
int qx::QxSqlDatabase::getPort ( ) const
bool qx::QxSqlDatabase::getSessionAutoTransaction ( ) const
bool qx::QxSqlDatabase::getSessionThrowable ( ) const
QStringList qx::QxSqlDatabase::getSqlDelimiterForColumnName ( ) const
QStringList qx::QxSqlDatabase::getSqlDelimiterForColumnNameAlias ( ) const
QStringList qx::QxSqlDatabase::getSqlDelimiterForTableName ( ) const
QStringList qx::QxSqlDatabase::getSqlDelimiterForTableNameAlias ( ) const
qx::dao::detail::IxSqlGenerator* qx::QxSqlDatabase::getSqlGenerator ( )
ph_style qx::QxSqlDatabase::getSqlPlaceHolderStyle ( ) const
bool qx::QxSqlDatabase::getTraceSqlBoundValues ( ) const
bool qx::QxSqlDatabase::getTraceSqlBoundValuesOnError ( ) const
int qx::QxSqlDatabase::getTraceSqlOnlySlowQueriesDatabase ( ) const
int qx::QxSqlDatabase::getTraceSqlOnlySlowQueriesTotal ( ) const
bool qx::QxSqlDatabase::getTraceSqlQuery ( ) const
bool qx::QxSqlDatabase::getTraceSqlRecord ( ) const
QString qx::QxSqlDatabase::getUserName ( ) const
bool qx::QxSqlDatabase::getValidatorThrowable ( ) const
bool qx::QxSqlDatabase::getVerifyOffsetRelation ( ) const
static bool qx::QxSqlDatabase::isEmpty ( ) [static]
void qx::QxSqlDatabase::setAddAutoIncrementIdToUpdateQuery ( bool  b,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setAddSqlSquareBracketsForColumnName ( bool  b,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setAddSqlSquareBracketsForTableName ( bool  b,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setAutoReplaceSqlAliasIntoQuery ( bool  b,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setConnectOptions ( const QString &  s,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
bool qx::QxSqlDatabase::setCurrentDatabaseByThread ( QSqlDatabase *  p) [protected]
void qx::QxSqlDatabase::setDatabaseName ( const QString &  s,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setDisplayTimerDetails ( bool  b,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setDriverName ( const QString &  s,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setFctDatabaseOpen ( type_fct_db_open  fct,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setForceParentIdToAllChildren ( bool  b,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setFormatSqlQueryBeforeLogging ( bool  b,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setHostName ( const QString &  s,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setPassword ( const QString &  s,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setPort ( int  i,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setSessionAutoTransaction ( bool  b,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setSessionThrowable ( bool  b,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setSqlDelimiterForColumnName ( const QStringList &  lst,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setSqlDelimiterForColumnNameAlias ( const QStringList &  lst,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setSqlDelimiterForTableName ( const QStringList &  lst,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setSqlDelimiterForTableNameAlias ( const QStringList &  lst,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setSqlGenerator ( qx::dao::detail::IxSqlGenerator_ptr  p,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setSqlPlaceHolderStyle ( ph_style  e,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setTraceSqlBoundValues ( bool  b,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setTraceSqlBoundValuesOnError ( bool  b,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setTraceSqlOnlySlowQueriesDatabase ( int  i,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setTraceSqlOnlySlowQueriesTotal ( int  i,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setTraceSqlQuery ( bool  b,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setTraceSqlRecord ( bool  b,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setUserName ( const QString &  s,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setValidatorThrowable ( bool  b,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)
void qx::QxSqlDatabase::setVerifyOffsetRelation ( bool  b,
bool  bJustForCurrentThread = false,
QSqlDatabase *  pJustForThisDatabase = NULL 
)

Friends And Related Function Documentation

friend class qx::dao::detail::IxDao_Helper [friend]

Definition at line 79 of file QxSqlDatabase.h.

friend class QxSingleton< QxSqlDatabase > [friend]

Definition at line 78 of file QxSqlDatabase.h.


Member Data Documentation

std::unique_ptr<QxSqlDatabaseImpl> qx::QxSqlDatabase::m_pImpl [private]

Private implementation idiom.

Definition at line 89 of file QxSqlDatabase.h.


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