QxOrm
1.5.0
C++ Object Relational Mapping library
|
qx::QxPersistableCollection<Key, Value, T> : concrete class for collection persistent classes based on qx::IxPersistableCollection and qx::QxCollection<Key, Value> More...
#include <IxPersistableCollection.h>
Public Member Functions | |
QxPersistableCollection () | |
virtual | ~QxPersistableCollection () |
virtual long | __count () const |
virtual void | __clear () |
virtual bool | __remove (long idx) |
virtual qx::IxPersistable_ptr | __at (long idx) const |
virtual long | qxCount (const qx::QxSqlQuery &query=qx::QxSqlQuery(), QSqlDatabase *pDatabase=NULL, const QStringList &relation=QStringList()) |
Return the number of lines in the table (database) mapped to the current C++ class (registered into QxOrm context) and filtered by a user SQL query. | |
virtual QSqlError | qxCount (long &lCount, const qx::QxSqlQuery &query=qx::QxSqlQuery(), QSqlDatabase *pDatabase=NULL, const QStringList &relation=QStringList()) |
Return the number of lines in the table (database) mapped to the current C++ class (registered into QxOrm context) and filtered by a user SQL query. | |
virtual QSqlError | qxFetchById (const QVariant &id=QVariant(), const QStringList &columns=QStringList(), const QStringList &relation=QStringList(), QSqlDatabase *pDatabase=NULL) |
Fetch current instance (retrieve all its properties) mapped to a table in the database (current instance must have a valid id before to be fetched without error, or pass the id to the first parameter of this method) | |
virtual QSqlError | qxFetchAll (qx::IxPersistableCollection *list=NULL, const QStringList &columns=QStringList(), const QStringList &relation=QStringList(), QSqlDatabase *pDatabase=NULL) |
Fetch a list of objects (retrieve all elements and properties associated) of current type (container registered into QxOrm context) mapped to a table in the database. | |
virtual QSqlError | qxFetchByQuery (const qx::QxSqlQuery &query, qx::IxPersistableCollection *list=NULL, const QStringList &columns=QStringList(), const QStringList &relation=QStringList(), QSqlDatabase *pDatabase=NULL) |
Fetch a list of objects (retrieve all elements and properties associated) of current type (container registered into QxOrm context) mapped to a table in the database and filtered by a user SQL query. | |
virtual QSqlError | qxInsert (const QStringList &relation=QStringList(), QSqlDatabase *pDatabase=NULL, bool bUseExecBatch=false) |
Insert current instance into database. | |
virtual QSqlError | qxUpdate (const qx::QxSqlQuery &query=qx::QxSqlQuery(), const QStringList &columns=QStringList(), const QStringList &relation=QStringList(), QSqlDatabase *pDatabase=NULL, bool bUseExecBatch=false) |
Update current instance into database (you can add a user SQL query to the default SQL query builded by QxOrm library) | |
virtual QSqlError | qxSave (const QStringList &relation=QStringList(), QSqlDatabase *pDatabase=NULL, qx::dao::save_mode::e_save_mode eSaveRecursiveMode=qx::dao::save_mode::e_none) |
Insert (if no exist) or update (if already exist) current instance into database. | |
virtual QSqlError | qxDeleteById (const QVariant &id=QVariant(), QSqlDatabase *pDatabase=NULL, bool bUseExecBatch=false) |
Delete current instance from database. | |
virtual QSqlError | qxDeleteAll (QSqlDatabase *pDatabase=NULL) |
Delete all lines of a table (database) mapped to current C++ class (registered into QxOrm context) | |
virtual QSqlError | qxDeleteByQuery (const qx::QxSqlQuery &query, QSqlDatabase *pDatabase=NULL) |
Delete all lines of a table (database) mapped to current C++ class (registered into QxOrm context) and filtered by a user SQL query. | |
virtual QSqlError | qxDestroyById (const QVariant &id=QVariant(), QSqlDatabase *pDatabase=NULL, bool bUseExecBatch=false) |
Delete current instance from database. | |
virtual QSqlError | qxDestroyAll (QSqlDatabase *pDatabase=NULL) |
Delete all lines of a table (database) mapped to current C++ class (registered into QxOrm context) | |
virtual QSqlError | qxDestroyByQuery (const qx::QxSqlQuery &query, QSqlDatabase *pDatabase=NULL) |
Delete all lines of a table (database) mapped to current C++ class (registered into QxOrm context) and filtered by a user SQL query. | |
virtual QSqlError | qxExecuteQuery (qx::QxSqlQuery &query, QSqlDatabase *pDatabase=NULL) |
Execute a custom SQL query or a stored procedure, all columns that can be mapped to the instance of type T will be fetched automatically. | |
virtual QSqlError | qxExecuteQuery (qx::QxSqlQuery &query, qx::IxPersistableCollection *list=NULL, QSqlDatabase *pDatabase=NULL) |
Execute a custom SQL query or a stored procedure, all columns that can be mapped to the instance of type T will be fetched automatically. | |
virtual qx_bool | qxExist (const QVariant &id=QVariant(), QSqlDatabase *pDatabase=NULL) |
Search if current instance already exists into database. | |
virtual qx::QxInvalidValueX | qxValidate (const QStringList &groups=QStringList()) |
Check if current instance is valid or not. | |
virtual std::shared_ptr < qx::IxPersistableCollection > | qxNewPersistableCollection (bool bAsList=false) const |
Create a new collection smart-pointer to fetch a list of items of current class type. | |
virtual qx::IxClass * | qxClass () const |
Access to introspection engine (or reflection engine) of QxOrm library. | |
virtual QString | toJson (const QString &format=QString()) const |
virtual QJsonValue | toJson_ (const QString &format=QString()) const |
virtual qx_bool | fromJson (const QString &json, const QString &format=QString()) |
virtual qx_bool | fromJson_ (const QJsonValue &json, const QString &format=QString()) |
Private Types | |
enum | { qx_is_valid = qx::trait::is_qx_registered<T>::value } |
qx::QxPersistableCollection<Key, Value, T> : concrete class for collection persistent classes based on qx::IxPersistableCollection and qx::QxCollection<Key, Value>
Definition at line 85 of file IxPersistableCollection.h.
anonymous enum [private] |
Definition at line 88 of file IxPersistableCollection.h.
qx::QxPersistableCollection< Key, Value, T >::QxPersistableCollection | ( | ) | [inline] |
Definition at line 92 of file IxPersistableCollection.h.
virtual qx::QxPersistableCollection< Key, Value, T >::~QxPersistableCollection | ( | ) | [inline, virtual] |
Definition at line 93 of file IxPersistableCollection.h.
virtual qx::IxPersistable_ptr qx::QxPersistableCollection< Key, Value, T >::__at | ( | long | idx | ) | const [inline, virtual] |
Implements qx::IxPersistableCollection.
Definition at line 98 of file IxPersistableCollection.h.
virtual void qx::QxPersistableCollection< Key, Value, T >::__clear | ( | ) | [inline, virtual] |
Implements qx::IxPersistableCollection.
Definition at line 96 of file IxPersistableCollection.h.
virtual long qx::QxPersistableCollection< Key, Value, T >::__count | ( | ) | const [inline, virtual] |
Implements qx::IxPersistableCollection.
Definition at line 95 of file IxPersistableCollection.h.
virtual bool qx::QxPersistableCollection< Key, Value, T >::__remove | ( | long | idx | ) | [inline, virtual] |
Implements qx::IxPersistableCollection.
Definition at line 97 of file IxPersistableCollection.h.
virtual qx_bool qx::QxPersistableCollection< Key, Value, T >::fromJson | ( | const QString & | json, |
const QString & | format = QString() |
||
) | [inline, virtual] |
Implements qx::IxPersistable.
Definition at line 205 of file IxPersistableCollection.h.
virtual qx_bool qx::QxPersistableCollection< Key, Value, T >::fromJson_ | ( | const QJsonValue & | json, |
const QString & | format = QString() |
||
) | [inline, virtual] |
Implements qx::IxPersistable.
Definition at line 208 of file IxPersistableCollection.h.
virtual qx::IxClass* qx::QxPersistableCollection< Key, Value, T >::qxClass | ( | ) | const [inline, virtual] |
Access to introspection engine (or reflection engine) of QxOrm library.
Implements qx::IxPersistable.
Definition at line 194 of file IxPersistableCollection.h.
virtual long qx::QxPersistableCollection< Key, Value, T >::qxCount | ( | const qx::QxSqlQuery & | query = qx::QxSqlQuery() , |
QSqlDatabase * | pDatabase = NULL , |
||
const QStringList & | relation = QStringList() |
||
) | [inline, virtual] |
Return the number of lines in the table (database) mapped to the current C++ class (registered into QxOrm context) and filtered by a user SQL query.
query | Define a user SQL query added to default SQL query builded by QxOrm library |
pDatabase | Connection to database (you can manage your own connection pool for example, you can also define a transaction, etc.); if NULL, a valid connection for the current thread is provided by qx::QxSqlDatabase singleton class |
relation | List of relationships keys to be fetched (eager fetch instead of default lazy fetch for a relation) |
qx::IxPersistable * p = ...;
p->qxCount(...) execute following SQL query :
SELECT COUNT(*) FROM my_table + XXX_JOINS_XXX + WHERE my_query...
Implements qx::IxPersistable.
Definition at line 100 of file IxPersistableCollection.h.
virtual QSqlError qx::QxPersistableCollection< Key, Value, T >::qxCount | ( | long & | lCount, |
const qx::QxSqlQuery & | query = qx::QxSqlQuery() , |
||
QSqlDatabase * | pDatabase = NULL , |
||
const QStringList & | relation = QStringList() |
||
) | [inline, virtual] |
Return the number of lines in the table (database) mapped to the current C++ class (registered into QxOrm context) and filtered by a user SQL query.
lCount | Output parameter with the number of lines in the table associated to the SQL query |
query | Define a user SQL query added to default SQL query builded by QxOrm library |
pDatabase | Connection to database (you can manage your own connection pool for example, you can also define a transaction, etc.); if NULL, a valid connection for the current thread is provided by qx::QxSqlDatabase singleton class |
relation | List of relationships keys to be fetched (eager fetch instead of default lazy fetch for a relation) |
qx::IxPersistable * p = ...;
p->qxCount(...) execute following SQL query :
SELECT COUNT(*) FROM my_table + XXX_JOINS_XXX + WHERE my_query...
Implements qx::IxPersistable.
Definition at line 106 of file IxPersistableCollection.h.
virtual QSqlError qx::QxPersistableCollection< Key, Value, T >::qxDeleteAll | ( | QSqlDatabase * | pDatabase = NULL | ) | [inline, virtual] |
Delete all lines of a table (database) mapped to current C++ class (registered into QxOrm context)
pDatabase | Connection to database (you can manage your own connection pool for example, you can also define a transaction, etc.); if NULL, a valid connection for the current thread is provided by qx::QxSqlDatabase singleton class |
qx::IxPersistable * p = ...;
p->qxDeleteAll(...) execute following SQL query :
DELETE FROM my_table
If a soft delete behavior is defined for current class, p->qxDeleteAll(...) execute following SQL query :
UPDATE my_table SET is_deleted='1'
Implements qx::IxPersistable.
Definition at line 164 of file IxPersistableCollection.h.
virtual QSqlError qx::QxPersistableCollection< Key, Value, T >::qxDeleteById | ( | const QVariant & | id = QVariant() , |
QSqlDatabase * | pDatabase = NULL , |
||
bool | bUseExecBatch = false |
||
) | [inline, virtual] |
Delete current instance from database.
id | Unique id to delete from database (if empty, check id of current instance) |
pDatabase | Connection to database (you can manage your own connection pool for example, you can also define a transaction, etc.); if NULL, a valid connection for the current thread is provided by qx::QxSqlDatabase singleton class |
bUseExecBatch | If true then use the QSqlQuery::execBatch() method to improve performance deleting a list of instances in database |
qx::IxPersistable * p = ...;
p->qxDeleteById(...) execute following SQL query :
DELETE FROM my_table WHERE my_id = ?
If a soft delete behavior is defined for current class, p->qxDeleteById(...) execute following SQL query :
UPDATE my_table SET is_deleted='1' WHERE my_id = ?
Implements qx::IxPersistable.
Definition at line 161 of file IxPersistableCollection.h.
virtual QSqlError qx::QxPersistableCollection< Key, Value, T >::qxDeleteByQuery | ( | const qx::QxSqlQuery & | query, |
QSqlDatabase * | pDatabase = NULL |
||
) | [inline, virtual] |
Delete all lines of a table (database) mapped to current C++ class (registered into QxOrm context) and filtered by a user SQL query.
query | Define a user SQL query added to default SQL query builded by QxOrm library |
pDatabase | Connection to database (you can manage your own connection pool for example, you can also define a transaction, etc.); if NULL, a valid connection for the current thread is provided by qx::QxSqlDatabase singleton class |
qx::IxPersistable * p = ...;
p->qxDeleteByQuery(...) execute following SQL query :
DELETE FROM my_table + WHERE my_query...
If a soft delete behavior is defined for current class, p->qxDeleteByQuery(...) execute following SQL query :
UPDATE my_table SET is_deleted='1' + WHERE my_query...
Implements qx::IxPersistable.
Definition at line 167 of file IxPersistableCollection.h.
virtual QSqlError qx::QxPersistableCollection< Key, Value, T >::qxDestroyAll | ( | QSqlDatabase * | pDatabase = NULL | ) | [inline, virtual] |
Delete all lines of a table (database) mapped to current C++ class (registered into QxOrm context)
pDatabase | Connection to database (you can manage your own connection pool for example, you can also define a transaction, etc.); if NULL, a valid connection for the current thread is provided by qx::QxSqlDatabase singleton class |
qx::IxPersistable * p = ...;
p->qxDestroyAll(...) execute following SQL query :
DELETE FROM my_table
Implements qx::IxPersistable.
Definition at line 173 of file IxPersistableCollection.h.
virtual QSqlError qx::QxPersistableCollection< Key, Value, T >::qxDestroyById | ( | const QVariant & | id = QVariant() , |
QSqlDatabase * | pDatabase = NULL , |
||
bool | bUseExecBatch = false |
||
) | [inline, virtual] |
Delete current instance from database.
id | Unique id to delete from database (if empty, check id of current instance) |
pDatabase | Connection to database (you can manage your own connection pool for example, you can also define a transaction, etc.); if NULL, a valid connection for the current thread is provided by qx::QxSqlDatabase singleton class |
bUseExecBatch | If true then use the QSqlQuery::execBatch() method to improve performance destroying a list of instances in database |
qx::IxPersistable * p = ...;
p->qxDestroyById(...) execute following SQL query :
DELETE FROM my_table WHERE my_id = ?
Implements qx::IxPersistable.
Definition at line 170 of file IxPersistableCollection.h.
virtual QSqlError qx::QxPersistableCollection< Key, Value, T >::qxDestroyByQuery | ( | const qx::QxSqlQuery & | query, |
QSqlDatabase * | pDatabase = NULL |
||
) | [inline, virtual] |
Delete all lines of a table (database) mapped to current C++ class (registered into QxOrm context) and filtered by a user SQL query.
query | Define a user SQL query added to default SQL query builded by QxOrm library |
pDatabase | Connection to database (you can manage your own connection pool for example, you can also define a transaction, etc.); if NULL, a valid connection for the current thread is provided by qx::QxSqlDatabase singleton class |
qx::IxPersistable * p = ...;
p->qxDestroyByQuery(...) execute following SQL query :
DELETE FROM my_table + WHERE my_query...
Implements qx::IxPersistable.
Definition at line 176 of file IxPersistableCollection.h.
virtual QSqlError qx::QxPersistableCollection< Key, Value, T >::qxExecuteQuery | ( | qx::QxSqlQuery & | query, |
QSqlDatabase * | pDatabase = NULL |
||
) | [inline, virtual] |
Execute a custom SQL query or a stored procedure, all columns that can be mapped to the instance of type T will be fetched automatically.
query | Define a user SQL query added to default SQL query builded by QxOrm library |
pDatabase | Connection to database (you can manage your own connection pool for example, you can also define a transaction, etc.); if NULL, a valid connection for the current thread is provided by qx::QxSqlDatabase singleton class |
Implements qx::IxPersistable.
Definition at line 179 of file IxPersistableCollection.h.
virtual QSqlError qx::QxPersistableCollection< Key, Value, T >::qxExecuteQuery | ( | qx::QxSqlQuery & | query, |
qx::IxPersistableCollection * | list = NULL , |
||
QSqlDatabase * | pDatabase = NULL |
||
) | [inline, virtual] |
Execute a custom SQL query or a stored procedure, all columns that can be mapped to the instance of type T will be fetched automatically.
query | Define a user SQL query added to default SQL query builded by QxOrm library |
list | Container to fetch all items (retrieve all elements and properties associated); list is cleared before executing SQL query |
pDatabase | Connection to database (you can manage your own connection pool for example, you can also define a transaction, etc.); if NULL, a valid connection for the current thread is provided by qx::QxSqlDatabase singleton class |
Implements qx::IxPersistable.
Definition at line 182 of file IxPersistableCollection.h.
virtual qx_bool qx::QxPersistableCollection< Key, Value, T >::qxExist | ( | const QVariant & | id = QVariant() , |
QSqlDatabase * | pDatabase = NULL |
||
) | [inline, virtual] |
Search if current instance already exists into database.
id | Unique id to check into database (if empty, check id of current instance) |
pDatabase | Connection to database (you can manage your own connection pool for example, you can also define a transaction, etc.); if NULL, a valid connection for the current thread is provided by qx::QxSqlDatabase singleton class |
qx::IxPersistable * p = ...;
p->qxExist(...) execute following SQL query :
SELECT * FROM my_table WHERE my_id = ?
Implements qx::IxPersistable.
Definition at line 185 of file IxPersistableCollection.h.
virtual QSqlError qx::QxPersistableCollection< Key, Value, T >::qxFetchAll | ( | qx::IxPersistableCollection * | list = NULL , |
const QStringList & | columns = QStringList() , |
||
const QStringList & | relation = QStringList() , |
||
QSqlDatabase * | pDatabase = NULL |
||
) | [inline, virtual] |
Fetch a list of objects (retrieve all elements and properties associated) of current type (container registered into QxOrm context) mapped to a table in the database.
list | Container to fetch all items (retrieve all elements and properties associated); list is cleared before executing SQL query |
columns | List of database table columns (mapped to properties of C++ class) to fetch (if empty, all columns are fetched) |
relation | List of relationships keys to fetch (eager fetch instead of default lazy fetch for a relation) : use "|" separator to put many relationships keys into this parameter |
pDatabase | Connection to database (you can manage your own connection pool for example, you can also define a transaction, etc.); if NULL, a valid connection for the current thread is provided by qx::QxSqlDatabase singleton class |
qx::IxPersistable * p = ...;
std::shared_ptr<qx::IxPersistableCollection> lst = p->qxNewPersistableCollection();
p->qxFetchAll(& lst, ...) execute following SQL query :
SELECT * FROM my_table
Implements qx::IxPersistable.
Definition at line 120 of file IxPersistableCollection.h.
virtual QSqlError qx::QxPersistableCollection< Key, Value, T >::qxFetchById | ( | const QVariant & | id = QVariant() , |
const QStringList & | columns = QStringList() , |
||
const QStringList & | relation = QStringList() , |
||
QSqlDatabase * | pDatabase = NULL |
||
) | [inline, virtual] |
Fetch current instance (retrieve all its properties) mapped to a table in the database (current instance must have a valid id before to be fetched without error, or pass the id to the first parameter of this method)
id | Unique id to fetch properties from database (if empty, check id of current instance) |
columns | List of database table columns (mapped to properties of C++ class) to fetch (if empty, all columns are fetched) |
relation | List of relationships keys to fetch (eager fetch instead of default lazy fetch for a relation) : use "|" separator to put many relationships keys into this parameter |
pDatabase | Connection to database (you can manage your own connection pool for example, you can also define a transaction, etc.); if NULL, a valid connection for the current thread is provided by qx::QxSqlDatabase singleton class |
qx::IxPersistable * p = ...;
p->qxFetchById(...) execute following SQL query :
SELECT * FROM my_table WHERE my_id = ?
Implements qx::IxPersistable.
Definition at line 112 of file IxPersistableCollection.h.
virtual QSqlError qx::QxPersistableCollection< Key, Value, T >::qxFetchByQuery | ( | const qx::QxSqlQuery & | query, |
qx::IxPersistableCollection * | list = NULL , |
||
const QStringList & | columns = QStringList() , |
||
const QStringList & | relation = QStringList() , |
||
QSqlDatabase * | pDatabase = NULL |
||
) | [inline, virtual] |
Fetch a list of objects (retrieve all elements and properties associated) of current type (container registered into QxOrm context) mapped to a table in the database and filtered by a user SQL query.
query | Define a user SQL query added to default SQL query builded by QxOrm library |
list | Container to fetch all items (retrieve all elements and properties associated); list is cleared before executing SQL query |
columns | List of database table columns (mapped to properties of C++ class) to fetch (if empty, all columns are fetched) |
relation | List of relationships keys to fetch (eager fetch instead of default lazy fetch for a relation) : use "|" separator to put many relationships keys into this parameter |
pDatabase | Connection to database (you can manage your own connection pool for example, you can also define a transaction, etc.); if NULL, a valid connection for the current thread is provided by qx::QxSqlDatabase singleton class |
qx::IxPersistable * p = ...;
std::shared_ptr<qx::IxPersistableCollection> lst = p->qxNewPersistableCollection();
p->qxFetchByQuery(my_query, & lst, ...) execute following SQL query :
SELECT * FROM my_table + WHERE my_query...
Implements qx::IxPersistable.
Definition at line 128 of file IxPersistableCollection.h.
virtual QSqlError qx::QxPersistableCollection< Key, Value, T >::qxInsert | ( | const QStringList & | relation = QStringList() , |
QSqlDatabase * | pDatabase = NULL , |
||
bool | bUseExecBatch = false |
||
) | [inline, virtual] |
Insert current instance into database.
relation | List of relationships keys to insert in others tables of database : use "|" separator to put many relationships keys into this parameter |
pDatabase | Connection to database (you can manage your own connection pool for example, you can also define a transaction, etc.); if NULL, a valid connection for the current thread is provided by qx::QxSqlDatabase singleton class |
bUseExecBatch | If true then use the QSqlQuery::execBatch() method to improve performance inserting a list of instances to database (but doesn't fill the last inserted identifier in the C++ instances) |
qx::IxPersistable * p = ...;
p->qxInsert(...) execute following SQL query :
INSERT INTO my_table (my_column_1, my_column_2, etc.) VALUES (?, ?, etc.)
Implements qx::IxPersistable.
Definition at line 136 of file IxPersistableCollection.h.
virtual std::shared_ptr<qx::IxPersistableCollection> qx::QxPersistableCollection< Key, Value, T >::qxNewPersistableCollection | ( | bool | bAsList = false | ) | const [inline, virtual] |
Create a new collection smart-pointer to fetch a list of items of current class type.
bAsList | If true, returns a list (array) of persistent instances instead of key/value hash-map |
Implements qx::IxPersistable.
Definition at line 191 of file IxPersistableCollection.h.
virtual QSqlError qx::QxPersistableCollection< Key, Value, T >::qxSave | ( | const QStringList & | relation = QStringList() , |
QSqlDatabase * | pDatabase = NULL , |
||
qx::dao::save_mode::e_save_mode | eSaveRecursiveMode = qx::dao::save_mode::e_none |
||
) | [inline, virtual] |
Insert (if no exist) or update (if already exist) current instance into database.
relation | List of relationships keys to insert or update in others tables of database : use "|" separator to put many relationships keys into this parameter |
pDatabase | Connection to database (you can manage your own connection pool for example, you can also define a transaction, etc.); if NULL, a valid connection for the current thread is provided by qx::QxSqlDatabase singleton class |
eSaveRecursiveMode | Parameter to call qx::dao::save_with_relation_recursive function |
qx::IxPersistable * p = ...;
p->qxSave(...) execute following SQL query :
INSERT INTO my_table (my_column_1, my_column_2, etc.) VALUES (?, ?, etc.)
or (if already exist into database) :
UPDATE my_table SET my_column_1 = ?, my_column_2 = ?, etc.
Implements qx::IxPersistable.
Definition at line 152 of file IxPersistableCollection.h.
virtual QSqlError qx::QxPersistableCollection< Key, Value, T >::qxUpdate | ( | const qx::QxSqlQuery & | query = qx::QxSqlQuery() , |
const QStringList & | columns = QStringList() , |
||
const QStringList & | relation = QStringList() , |
||
QSqlDatabase * | pDatabase = NULL , |
||
bool | bUseExecBatch = false |
||
) | [inline, virtual] |
Update current instance into database (you can add a user SQL query to the default SQL query builded by QxOrm library)
query | Define a user SQL query added to default SQL query builded by QxOrm library |
columns | List of database table columns (mapped to properties of C++ class) to update (if empty, all columns are updated) |
relation | List of relationships keys to update in others tables of database : use "|" separator to put many relationships keys into this parameter |
pDatabase | Connection to database (you can manage your own connection pool for example, you can also define a transaction, etc.); if NULL, a valid connection for the current thread is provided by qx::QxSqlDatabase singleton class |
bUseExecBatch | If true then use the QSqlQuery::execBatch() method to improve performance updating a list of instances in database |
qx::IxPersistable * p = ...;
p->qxUpdate(...) execute following SQL query :
UPDATE my_table SET my_column_1 = ?, my_column_2 = ?, etc. + WHERE my_query...
Implements qx::IxPersistable.
Definition at line 144 of file IxPersistableCollection.h.
virtual qx::QxInvalidValueX qx::QxPersistableCollection< Key, Value, T >::qxValidate | ( | const QStringList & | groups = QStringList() | ) | [inline, virtual] |
Check if current instance is valid or not.
groups | List of groups to check (defined into QxValidator module for current class) |
For more details about QxValidator module : https://www.qxorm.com/qxorm_en/faq.html#faq_250
Implements qx::IxPersistable.
Definition at line 188 of file IxPersistableCollection.h.
virtual QString qx::QxPersistableCollection< Key, Value, T >::toJson | ( | const QString & | format = QString() | ) | const [inline, virtual] |
Implements qx::IxPersistable.
Definition at line 199 of file IxPersistableCollection.h.
virtual QJsonValue qx::QxPersistableCollection< Key, Value, T >::toJson_ | ( | const QString & | format = QString() | ) | const [inline, virtual] |
Implements qx::IxPersistable.
Definition at line 202 of file IxPersistableCollection.h.