|
SpikeStream Library
0.2
|
#include <AbstractDao.h>
Public Member Functions | |
| AbstractDao (const DBInfo &dbInfo) | |
| AbstractDao () | |
| virtual | ~AbstractDao () |
| DBInfo | getDBInfo () |
| QThread * | getThread () |
Protected Member Functions | |
| void | checkDatabase () |
| void | closeDatabaseConnection () |
| void | connectToDatabase () |
| bool | isConnected () |
| void | executeQuery (QSqlQuery &query) |
| void | executeQuery (const QString &queryStr) |
| QSqlQuery | getQuery () |
| QSqlQuery | getQuery (const QString &queryStr) |
| void | setDBInfo (const DBInfo &dbInfo) |
Wraps the functionality used for connecting to databases and running queries.
Definition at line 15 of file AbstractDao.h.
| AbstractDao::AbstractDao | ( | const DBInfo & | dbInfo | ) |
Standard constructor. Creats connection with unique name.
Definition at line 13 of file AbstractDao.cpp.
Empty constructor.
Definition at line 29 of file AbstractDao.cpp.
| AbstractDao::~AbstractDao | ( | ) | [virtual] |
Destructor. Closes connection and removes database
Definition at line 36 of file AbstractDao.cpp.
| void AbstractDao::checkDatabase | ( | ) | [protected] |
Runs basic checks on the database before a query. NOTE: It is assumed that it exists and is open, since this should be checked in the constructor. Thread checks have to be done at runtime.
Definition at line 65 of file AbstractDao.cpp.
| void AbstractDao::closeDatabaseConnection | ( | ) | [protected] |
Closes the database connection.
Definition at line 88 of file AbstractDao.cpp.
| void AbstractDao::connectToDatabase | ( | ) | [protected] |
Connects to the database
Definition at line 94 of file AbstractDao.cpp.
| void AbstractDao::executeQuery | ( | QSqlQuery & | query | ) | [protected] |
Executes the query
Definition at line 120 of file AbstractDao.cpp.
| void AbstractDao::executeQuery | ( | const QString & | queryStr | ) | [protected] |
Creates and executes a query with the specified string
Definition at line 129 of file AbstractDao.cpp.
Returns a copy of the information about the database
Definition at line 46 of file AbstractDao.cpp.
| QSqlQuery AbstractDao::getQuery | ( | ) | [protected] |
Returns a query object for the database. Query has setForwardOnly set to true.
Definition at line 137 of file AbstractDao.cpp.
| QSqlQuery AbstractDao::getQuery | ( | const QString & | queryStr | ) | [protected] |
Returns a query object for the database using specified string to create query. Query has setForwardOnly set to true.
Definition at line 147 of file AbstractDao.cpp.
| QThread * AbstractDao::getThread | ( | ) |
Returns the thread that this class was created in. Methods in this class must not be called from a different thread.
Definition at line 53 of file AbstractDao.cpp.
| bool AbstractDao::isConnected | ( | ) | [protected] |
Returns true if the database used by this class exists and is connected.
Definition at line 78 of file AbstractDao.cpp.
| void spikestream::AbstractDao::setDBInfo | ( | const DBInfo & | dbInfo | ) | [inline, protected] |
Definition at line 32 of file AbstractDao.h.