32#ifndef _QX_DAO_THROWABLE_H_
33#define _QX_DAO_THROWABLE_H_
101inline void insert(T & t, QSqlDatabase * pDatabase = NULL,
bool bUseExecBatch =
false)
117inline void save(T & t, QSqlDatabase * pDatabase = NULL)
135inline void delete_by_id(T & t, QSqlDatabase * pDatabase = NULL,
bool bUseExecBatch =
false)
150inline void destroy_by_id(T & t, QSqlDatabase * pDatabase = NULL,
bool bUseExecBatch =
false)
166inline void delete_all(QSqlDatabase * pDatabase = NULL)
179inline void destroy_all(QSqlDatabase * pDatabase = NULL)
223inline void create_table(QSqlDatabase * pDatabase = NULL)
373inline void insert_with_relation(
const QString & relation, T & t, QSqlDatabase * pDatabase = NULL)
388inline void insert_with_relation(
const QStringList & relation, T & t, QSqlDatabase * pDatabase = NULL)
417inline void update_with_relation(
const QString & relation, T & t, QSqlDatabase * pDatabase = NULL)
448inline void update_with_relation(
const QStringList & relation, T & t, QSqlDatabase * pDatabase = NULL)
510inline void save_with_relation(
const QString & relation, T & t, QSqlDatabase * pDatabase = NULL)
527inline void save_with_relation(
const QStringList & relation, T & t, QSqlDatabase * pDatabase = NULL)
581inline void fetch_by_id(T & t, QSqlDatabase * pDatabase = NULL,
const QStringList & columns = QStringList())
596inline void fetch_all(T & t, QSqlDatabase * pDatabase = NULL,
const QStringList & columns = QStringList())
612inline void fetch_by_query(
const qx::QxSqlQuery & query, T & t, QSqlDatabase * pDatabase = NULL,
const QStringList & columns = QStringList())
628inline void update(T & t, QSqlDatabase * pDatabase = NULL,
const QStringList & columns = QStringList(),
bool bUseExecBatch =
false)
645inline void update_by_query(
const qx::QxSqlQuery & query, T & t, QSqlDatabase * pDatabase = NULL,
const QStringList & columns = QStringList(),
bool bUseExecBatch =
false)
Provide template functions to map C++ class registered into QxOrm context with table database (ORM - ...
Define a SQL error exception and retrieve QSqlError type of Qt library.
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::ptr<T> : provide a classic smart-pointer (like boost::shared_ptr<T> or QSharedPointer<T>) wi...
qx::dao::sql_error : define a SQL error exception and retrieve QSqlError type of Qt library
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...
QX_DLL_EXPORT QSqlError call_query(qx::QxSqlQuery &query, QSqlDatabase *pDatabase=NULL)
qx::dao::call_query function can be used to call a custom SQL query or a stored procedure
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...
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...
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...
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...
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...
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...
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...
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...
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