46#include <QtSql/qsqldatabase.h>
47#include <QtSql/qsqlquery.h>
48#include <QtSql/qsqlrecord.h>
49#include <QtSql/qsqlfield.h>
50#include <QtSql/qsqlerror.h>
51#include <QtSql/qsqldriver.h>
61class QxSqlRelationParams;
142inline QSqlError
insert(T & t, QSqlDatabase * pDatabase = NULL,
bool bUseExecBatch =
false)
158inline QSqlError
save(T & t, QSqlDatabase * pDatabase = NULL)
176inline QSqlError
delete_by_id(T & t, QSqlDatabase * pDatabase = NULL,
bool bUseExecBatch =
false)
191inline QSqlError
destroy_by_id(T & t, QSqlDatabase * pDatabase = NULL,
bool bUseExecBatch =
false)
582inline QSqlError
save_with_relation(
const QStringList & relation, T & t, QSqlDatabase * pDatabase = NULL)
636inline QSqlError
fetch_by_id(T & t, QSqlDatabase * pDatabase = NULL,
const QStringList & columns = QStringList())
651inline QSqlError
fetch_all(T & t, QSqlDatabase * pDatabase = NULL,
const QStringList & columns = QStringList())
683inline QSqlError
update(T & t, QSqlDatabase * pDatabase = NULL,
const QStringList & columns = QStringList(),
bool bUseExecBatch =
false)
700inline QSqlError
update_by_query(
const qx::QxSqlQuery & query, T & t, QSqlDatabase * pDatabase = NULL,
const QStringList & columns = QStringList(),
bool bUseExecBatch =
false)
qx_bool : QxOrm library boolean type with code and description message when an error occured
qx::dao::ptr<T> : provide a classic smart-pointer (like boost::shared_ptr<T> or QSharedPointer<T>) wi...
Soft delete (or logical delete) behavior to update a row into database (flag it as deleted) instead o...
Define a user SQL query added to default SQL query builded by QxOrm library, and used by qx::dao::xxx...
To improve performance, if you know that you are just inserting or updating items in database.
qx_bool : boolean type with code and description message when an error occured
qx::QxSqlQuery : define a user SQL query added to default SQL query builded by QxOrm library,...
qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL querie...
qx::dao::detail::IxDao_Helper : helper class to communicate with database
qx::dao::ptr<T> : provide a classic smart-pointer (like boost::shared_ptr<T> or QSharedPointer<T>) wi...
QSqlError destroy_all(QSqlDatabase *pDatabase=NULL)
Destroy all lines of a table (database) mapped to a C++ class T (registered into QxOrm context),...
QSqlError execute_query(qx::QxSqlQuery &query, T &t, QSqlDatabase *pDatabase=NULL)
Execute a custom SQL query or a stored procedure, all columns that can be mapped to the instance of t...
QSqlError update_with_all_relation(T &t, QSqlDatabase *pDatabase=NULL)
Update an element and all its relationships (or a list of elements + all relationships) into database...
QSqlError save(T &t, QSqlDatabase *pDatabase=NULL)
Insert (if no exist) or update (if already exist) an element or a list of elements into database.
QSqlError update_with_relation(const QString &relation, T &t, QSqlDatabase *pDatabase=NULL)
Update an element and its relationships (or a list of elements + relationships) into database.
QSqlError update_by_query_with_all_relation(const qx::QxSqlQuery &query, T &t, QSqlDatabase *pDatabase=NULL)
Update an element and all its relationships (or a list of elements + all relationships) into database...
QSqlError fetch_by_id(T &t, QSqlDatabase *pDatabase=NULL, const QStringList &columns=QStringList())
Fetch an object t (retrieve all its properties) of type T (registered into QxOrm context) mapped to a...
QSqlError fetch_by_query_with_relation(const QString &relation, const qx::QxSqlQuery &query, T &t, QSqlDatabase *pDatabase=NULL)
Fetch a list of objects (retrieve all elements and properties associated) of type T (container regist...
QSqlError fetch_by_id_with_relation(const QString &relation, T &t, QSqlDatabase *pDatabase=NULL)
Fetch an object t (retrieve all its properties) of type T (registered into QxOrm context) mapped to a...
void on_after_update(T *t, qx::dao::detail::IxDao_Helper *dao)
Callback after updating an object into database (here is an example using QxOrm Trigger)
QSqlError delete_by_id(T &t, QSqlDatabase *pDatabase=NULL, bool bUseExecBatch=false)
Delete a line (or list of lines) of a table (database) mapped to a C++ object of type T (registered i...
qx_bool exist(T &t, QSqlDatabase *pDatabase=NULL)
Search if an element (or list of elements) already exists into database.
QSqlError insert_with_all_relation(T &t, QSqlDatabase *pDatabase=NULL)
Insert an element and all its relationships (or a list of elements + all relationships) into database...
void on_after_delete(T *t, qx::dao::detail::IxDao_Helper *dao)
Callback after deleting an object into database (here is an example using QxOrm trigger)
void on_before_delete(T *t, qx::dao::detail::IxDao_Helper *dao)
Callback before deleting an object into database (here is an example using QxOrm Trigger)
QSqlError save_with_relation(const QString &relation, T &t, QSqlDatabase *pDatabase=NULL)
Insert (if no exist) or update (if already exist) an element and its relationships (or a list of elem...
QSqlError insert_with_relation(const QString &relation, T &t, QSqlDatabase *pDatabase=NULL)
Insert an element and its relationships (or a list of elements + relationships) into database.
QSqlError insert(T &t, QSqlDatabase *pDatabase=NULL, bool bUseExecBatch=false)
Insert an element or a list of elements into database.
QSqlError destroy_by_query(const qx::QxSqlQuery &query, QSqlDatabase *pDatabase=NULL)
Destroy all lines of a table (database) mapped to a C++ class T (registered into QxOrm context) and f...
void on_before_fetch(T *t, qx::dao::detail::IxDao_Helper *dao)
Callback before fetching an object from database (here is an example using QxOrm Trigger)
QSqlError save_with_all_relation(T &t, QSqlDatabase *pDatabase=NULL)
Insert (if no exist) or update (if already exist) an element and all its relationships (or a list of ...
QSqlError delete_all(QSqlDatabase *pDatabase=NULL)
Delete all lines of a table (database) mapped to a C++ class T (registered into QxOrm context)
QSqlError update_by_query(const qx::QxSqlQuery &query, T &t, QSqlDatabase *pDatabase=NULL, const QStringList &columns=QStringList(), bool bUseExecBatch=false)
Update an element or a list of elements into database (adding a user SQL query to the default SQL que...
QSqlError fetch_by_query(const qx::QxSqlQuery &query, T &t, QSqlDatabase *pDatabase=NULL, const QStringList &columns=QStringList())
Fetch a list of objects (retrieve all elements and properties associated) of type T (container regist...
QSqlError update_by_query_with_relation(const QString &relation, const qx::QxSqlQuery &query, T &t, QSqlDatabase *pDatabase=NULL)
Update an element and its relationships (or a list of elements + relationships) into database (adding...
void on_before_update(T *t, qx::dao::detail::IxDao_Helper *dao)
Callback before updating an object into database (here is an example using QxOrm Trigger)
QSqlError update(T &t, QSqlDatabase *pDatabase=NULL, const QStringList &columns=QStringList(), bool bUseExecBatch=false)
Update an element or a list of elements into database.
QSqlError fetch_all(T &t, QSqlDatabase *pDatabase=NULL, const QStringList &columns=QStringList())
Fetch a list of objects (retrieve all elements and properties associated) of type T (container regist...
void on_after_fetch(T *t, qx::dao::detail::IxDao_Helper *dao)
Callback after fetching an object from database (here is an example using QxOrm trigger)
QSqlError update_optimized_by_query(const qx::QxSqlQuery &query, qx::dao::ptr< T > &ptr, QSqlDatabase *pDatabase=NULL, bool bUseExecBatch=false)
Update only modified fields/properties of an element or a list of elements into database (using is di...
QSqlError fetch_by_query_with_all_relation(const qx::QxSqlQuery &query, T &t, QSqlDatabase *pDatabase=NULL)
Fetch a list of objects (retrieve all elements and properties + all relationships associated) of type...
QSqlError delete_by_query(const qx::QxSqlQuery &query, QSqlDatabase *pDatabase=NULL)
Delete all lines of a table (database) mapped to a C++ class T (registered into QxOrm context) and fi...
QSqlError update_optimized(qx::dao::ptr< T > &ptr, QSqlDatabase *pDatabase=NULL, bool bUseExecBatch=false)
Update only modified fields/properties of an element or a list of elements into database (using is di...
void on_after_insert(T *t, qx::dao::detail::IxDao_Helper *dao)
Callback after inserting an object into database (here is an example using QxOrm Trigger)
QSqlError create_table(QSqlDatabase *pDatabase=NULL)
Create a table into database (with all columns) mapped to a C++ class T (registered into QxOrm contex...
QSqlError count_with_relation(long &lCount, const QStringList &relation, const qx::QxSqlQuery &query=qx::QxSqlQuery(), QSqlDatabase *pDatabase=NULL)
Return the number of lines in the table (database) mapped to the C++ class T (registered into QxOrm c...
QSqlError fetch_all_with_relation(const QString &relation, T &t, QSqlDatabase *pDatabase=NULL)
Fetch a list of objects (retrieve all elements and properties associated) of type T (container regist...
QSqlError save_with_relation_recursive(T &t, qx::dao::save_mode::e_save_mode eSaveMode=qx::dao::save_mode::e_check_insert_or_update, QSqlDatabase *pDatabase=NULL, qx::QxSqlRelationParams *pRelationParams=NULL)
Insert (if no exist) or update (if already exist) recursively an element and all levels of relationsh...
void on_before_insert(T *t, qx::dao::detail::IxDao_Helper *dao)
Callback before inserting an object into database (here is an example using QxOrm Trigger)
long count(const qx::QxSqlQuery &query=qx::QxSqlQuery(), QSqlDatabase *pDatabase=NULL)
Return the number of lines in the table (database) mapped to the C++ class T (registered into QxOrm c...
QSqlError fetch_by_id_with_all_relation(T &t, QSqlDatabase *pDatabase=NULL)
Fetch an object t (retrieve all its properties and relationships) of type T (registered into QxOrm co...
QSqlError destroy_by_id(T &t, QSqlDatabase *pDatabase=NULL, bool bUseExecBatch=false)
Destroy a line (or list of lines) of a table (database) mapped to a C++ object of type T (registered ...
QSqlError fetch_all_with_all_relation(T &t, QSqlDatabase *pDatabase=NULL)
Fetch a list of objects (retrieve all elements and properties + all relationships associated) of type...
Root namespace for all QxOrm library features.
@ e_check_insert_or_update