|
| SqlDB () |
|
| ISqlDB (qint64 updateInterval=DEFAULT_UPDATE_INTERVAL, SqlDBCasheWriteMode mode=SqlDBCasheWriteMode::Default) |
| ISqlDB This is default constructor of dbcache.
|
|
| ~ISqlDB () override |
|
SqlDBWriter * | writer () const |
| writer This method return is database writer object. For more inforamation about writer see the SqlDBWriter class.
|
|
void | setWriter (SqlDBWriter *writer) |
| setWriter This method set new writer for this cache.
|
|
bool | getAllObjects (const PKG::DBObject &templateObject, QList< QSharedPointer< QH::PKG::DBObject > > &result) override |
|
bool | updateObject (const QSharedPointer< QH::PKG::DBObject > &saveObject, bool wait=false) override |
|
bool | deleteObject (const QSharedPointer< QH::PKG::DBObject > &delObj, bool wait=false) override |
|
bool | insertObject (const QSharedPointer< QH::PKG::DBObject > &saveObject, bool wait=false, const QWeakPointer< unsigned int > &autoincrementIdResult={}) override |
|
bool | replaceObject (const QSharedPointer< QH::PKG::DBObject > &saveObject, bool wait=false) override |
|
bool | doQuery (const QString &query, const QVariantMap &bindValues, bool wait=false, QSqlQuery *result=nullptr) const override |
| doQuery This method execute a query in this database.
|
|
bool | doSql (const QString &sqlFile, bool wait) const override |
| doSql This method execute a query in this database.
|
|
bool | changeObjects (const PKG::DBObject &templateObject, const std::function< bool(const QSharedPointer< PKG::DBObject > &)> &changeAction) |
| changeObjects This method change object of the database.
|
|
qint64 | getUpdateInterval () const |
| getUpdateInterval This method return update interval for save changes into database. This is work for default and On_New_Thread mdes. For more information see the QH::SqlDBCasheWriteMode enum.
|
|
void | setUpdateInterval (const qint64 &value) |
| getUpdateInterval This method set new value of an update interval for save changes into database. This is work for default and On_New_Thread mdes. For more information see the QH::SqlDBCasheWriteMode enum.
|
|
virtual bool | init (const QString &initDbParams="") |
| init This method init the cache object and invoke the SqlDBWriter::initDb method.
|
|
virtual bool | init (const QVariantMap ¶ms) |
| init This method init the cache object and invoke the SqlDBWriter::initDb method.
|
|
void | setSQLSources (const QStringList &list) override |
| setSQLSources This method set sql sources for deployed database.
|
|
template<class TYPE > |
QSharedPointer< TYPE > | getObject (const TYPE &templateVal) |
| getObject this method return a strong pointer to DBObject created by select method of the template object (templateVal).
|
|
QSharedPointer< PKG::DBObject > | getObjectRaw (const PKG::DBObject &templateVal) |
| getObjectRaw This method return object without test object type.
|
|
virtual bool | getAllObjects (const PKG::DBObject &templateObject, QList< QSharedPointer< PKG::DBObject > > &result)=0 |
| getAllObjects This method execute a select method of the templateObject and return list of all selected from databaes or cache objects
|
|
virtual bool | replaceObject (const QSharedPointer< PKG::DBObject > &saveObject, bool wait)=0 |
| replaceObject This method execute a replace method of the saveObject and insert or save if not exists, all changes into database.
|
|
virtual bool | updateObject (const QSharedPointer< PKG::DBObject > &saveObject, bool wait)=0 |
| updateObject This method execute a update method of the saveObject and save all changes into database.
|
|
virtual bool | insertObject (const QSharedPointer< PKG::DBObject > &saveObject, bool wait, const QWeakPointer< unsigned int > &autoincrementIdResult)=0 |
| insertObject This method execute a insert method of the saveObject and insert it into database.
|
|
virtual bool | deleteObject (const QSharedPointer< PKG::DBObject > &obj, bool wait)=0 |
| deleteObject This method execute a delete method of obj and remove current object from database.
|
|
| SoftDelete () |
|
virtual | ~SoftDelete () |
| ~SoftDelete This destructor has bin crashed if the softDelete method not will be invoked before delete this object. IF you try delete this object on release distribution then you get error message only without invoked std::abort method.
|
|
void | softDelete () |
| softDelete This method remove this object and save all changes into database.
|
|
The SqlDB class This is base implementation fo datatbase. The SqlDB do not use caches, all request run on the sqlwtiter class.
Definition at line 18 of file sqldb.h.