| QxOrm 1.4.4 C++ Object Relational Mapping library

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories

Classes | Namespaces | Files | Functions
QxDao : QxOrm library database communication used by persistence engine (ORM - Object Relational Mapping)

## Classes
class | qx::dao::detail::IxDao_Helper
| qx::dao::detail::IxDao_Helper : helper class to communicate with database More...
class | qx::IxPersistable
| qx::IxPersistable : common interface (abstract class) for persistents classes using QX_PERSISTABLE_HPP() and QX_PERSISTABLE_CPP() macros More...
class | qx::IxPersistableCollection< T >
| qx::IxPersistableCollection<T>::type : return the collection type used by qx::IxPersistable interface, qx::QxCollection<type_primary_key, std::shared_ptr<my_type>> More...
class | qx::IxSqlQueryBuilder
| qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database More...
class | qx::IxSqlRelation
| qx::IxSqlRelation : common interface for all relationships defined between 2 classes (or between 2 tables in database) More...
struct | qx::dao::detail::QxDaoAsyncParams
| qx::dao::detail::QxDaoAsyncParams : all parameters for qx::QxDaoAsync class to execute queries More...
class | qx::dao::detail::QxDaoAsyncRunner
| qx::dao::detail::QxDaoAsyncRunner : class with a slot to execute queries in another thread More...
class | qx::QxDaoAsync
| qx::QxDaoAsync : helper class to execute SQL queries in another thread (asynchronous way) using qx::IxPersistable interface More...
class | qx::dao::ptr< T >
| qx::dao::ptr<T> : provide a classic smart-pointer (like boost::shared_ptr<T> or QSharedPointer<T>) with some features associated with QxDao module of QxOrm library More...
struct | qx::dao::strategy
| qx::dao::strategy : class inheritance strategy and database (Concrete Table Inheritance is the default strategy used by QxOrm library) More...
class | qx::QxDateNeutral
| qx::QxDateNeutral : helper class to store a date value into database under neutral format (YYYYMMDD) => cross database compatibility More...
class | qx::QxDateTimeNeutral
| qx::QxDateTimeNeutral : helper class to store a date-time value into database under neutral format (YYYYMMDDHHMMSS) => cross database compatibility More...
class | qx::IxRepository
| qx::IxRepository : common interface for all repositories to provide access to database by introspection using QObject class or qx::IxCollection class More...
class | qx::QxRepository< T >
| qx::QxRepository<T> : repository to provide a common interface to communicate with database More...
class | qx::QxRepositoryX
| qx::QxRepositoryX : list of all repositories registered using qx::register_repository<T> function More...
class | qx::QxSession
| qx::QxSession : define a session to manage automatically database transactions (using C++ RAII) More...
class | qx::QxSoftDelete
| qx::QxSoftDelete : soft delete (or logical delete) behavior to update a row into database (flag it as deleted) instead of delete it from database More...
class | qx::QxSqlDatabase
| qx::QxSqlDatabase : define all parameters to connect to database and retrieve a valid connection by thread (this class is a singleton and is thread-safe) More...
class | qx::dao::detail::IxSqlElement
| qx::dao::detail::IxSqlElement : common interface for all SQL elements to build SQL query More...
class | qx::dao::detail::QxSqlCompare
| qx::dao::detail::QxSqlCompare : SQL element to compare value (==, <, >, <=, >=, LIKE, NOT LIKE, etc.) More...
class | qx::dao::detail::QxSqlElementTemp
| qx::dao::detail::QxSqlElementTemp : temporary SQL element (need to be cloned to be used) More...
class | qx::dao::detail::QxSqlExpression
| qx::dao::detail::QxSqlExpression : SQL element to build a SQL expression (WHERE, AND, OR, etc.) More...
class | qx::dao::detail::QxSqlFreeText
| qx::dao::detail::QxSqlFreeText : possibility to add free text to SQL query More...
class | qx::dao::detail::QxSqlIn
| qx::dao::detail::QxSqlIn : SQL element to verify a list of values (IN, NOT IN, etc.) More...
class | qx::dao::detail::QxSqlIsBetween
| qx::dao::detail::QxSqlIsBetween : SQL element to verify if a value is included into 2 other values More...
class | qx::dao::detail::QxSqlIsNull
| qx::dao::detail::QxSqlIsNull : SQL element to verify if a value is null or not null (IS NULL, IS NOT NULL) More...
class | qx::dao::detail::QxSqlLimit
| qx::dao::detail::QxSqlLimit : SQL element to limit rows count fetched from database More...
class | qx::dao::detail::QxSqlSort
| qx::dao::detail::QxSqlSort : SQL element to sort or to group list of elements fetched from database (ORDER BY, GROUP BY) More...
class | qx::dao::sql_error
| qx::dao::sql_error : define a SQL error exception and retrieve QSqlError type of Qt library More...
class | qx::dao::detail::IxSqlGenerator
| qx::dao::detail::IxSqlGenerator : common interface for all SQL generators to build SQL query specific for each database More...
class | qx::dao::detail::QxSqlGenerator_MSSQLServer
| qx::dao::detail::QxSqlGenerator_MSSQLServer : SQL generator for Microsoft SQL Server database More...
class | qx::dao::detail::QxSqlGenerator_MySQL
| qx::dao::detail::QxSqlGenerator_MySQL : SQL generator for MySQL database More...
class | qx::dao::detail::QxSqlGenerator_Oracle
| qx::dao::detail::QxSqlGenerator_Oracle : SQL generator for Oracle database More...
class | qx::dao::detail::QxSqlGenerator_PostgreSQL
| qx::dao::detail::QxSqlGenerator_PostgreSQL : SQL generator for PostgreSQL database More...
class | qx::dao::detail::QxSqlGenerator_SQLite
| qx::dao::detail::QxSqlGenerator_SQLite : SQL generator for SQLite database More...
class | qx::dao::detail::QxSqlGenerator_Standard
| qx::dao::detail::QxSqlGenerator_Standard : SQL generator to build standard SQL query More...
struct | qx::dao::sql_join
| qx::dao::sql_join : define how to join 2 tables into SQL query (LEFT OUTER JOIN, INNER JOIN, etc...) More...
class | qx::QxSqlQuery
| qx::QxSqlQuery : define a user SQL query added to default SQL query builded by QxOrm library, and used by qx::dao::xxx functions to filter elements fetched from database More...
class | qx::QxSqlQueryBuilder< T >
| qx::QxSqlQueryBuilder<T> : concrete SQL query builder for class T with a cache mechanism to backup and restore queries already built by the program More...
class | qx::QxSqlQueryBuilder_Count< T >
| qx::QxSqlQueryBuilder_Count<T> : concrete SQL query builder for class T to build a COUNT SQL query More...
class | qx::QxSqlQueryBuilder_Exist< T >
| qx::QxSqlQueryBuilder_Exist<T> : concrete SQL query builder for class T to build an EXIST SQL query More...
class | qx::QxSqlQueryBuilder_FetchAll< T >
| qx::QxSqlQueryBuilder_FetchAll<T> : concrete SQL query builder for class T to build a FETCH ALL SQL query More...
class | qx::QxSqlQueryBuilder_FetchById< T >
| qx::QxSqlQueryBuilder_FetchById<T> : concrete SQL query builder for class T to build a FETCH BY ID SQL query More...
class | qx::QxSqlQueryBuilder_Insert< T >
| qx::QxSqlQueryBuilder_Insert<T> : concrete SQL query builder for class T to build an INSERT SQL query More...
class | qx::QxSqlQueryBuilder_Update< T >
| qx::QxSqlQueryBuilder_Update<T> : concrete SQL query builder for class T to build an UPDATE SQL query More...
class | qx::QxSqlQueryBuilder_DeleteAll< T >
| qx::QxSqlQueryBuilder_DeleteAll<T> : concrete SQL query builder for class T to build a DELETE ALL SQL query More...
class | qx::QxSqlQueryBuilder_SoftDeleteAll< T >
| qx::QxSqlQueryBuilder_SoftDeleteAll<T> : concrete SQL query builder for class T to build a SOFT DELETE ALL SQL query More...
class | qx::QxSqlQueryBuilder_DeleteById< T >
| qx::QxSqlQueryBuilder_DeleteById<T> : concrete SQL query builder for class T to build a DELETE BY ID SQL query More...
class | qx::QxSqlQueryBuilder_SoftDeleteById< T >
| qx::QxSqlQueryBuilder_SoftDeleteById<T> : concrete SQL query builder for class T to build a SOFT DELETE BY ID SQL query More...
class | qx::QxSqlQueryBuilder_CreateTable< T >
| qx::QxSqlQueryBuilder_CreateTable<T> : concrete SQL query builder for class T to build a CREATE TABLE SQL query More...
class | qx::QxSqlQueryBuilder_FetchAll_WithRelation< T >
| qx::QxSqlQueryBuilder_FetchAll_WithRelation<T> : concrete SQL query builder for class T to build a FETCH ALL WITH RELATION SQL query More...
class | qx::QxSqlQueryBuilder_FetchById_WithRelation< T >
| qx::QxSqlQueryBuilder_FetchById_WithRelation<T> : concrete SQL query builder for class T to build a FETCH BY ID WITH RELATION SQL query More...
class | qx::QxSqlRelation< DataType, Owner >
| qx::QxSqlRelation<DataType, Owner> : base class for all relationships defined between 2 classes (or between 2 tables in database) More...
class | qx::QxSqlRelation_ManyToMany< DataType, Owner >
| qx::QxSqlRelation_ManyToMany<DataType, Owner> : manage a relationship many-to-many defined between 2 classes (or between 2 tables in database) More...
class | qx::QxSqlRelation_ManyToOne< DataType, Owner >
| qx::QxSqlRelation_ManyToOne<DataType, Owner> : manage a relationship many-to-one defined between 2 classes (or between 2 tables in database) More...
class | qx::QxSqlRelation_OneToMany< DataType, Owner >
| qx::QxSqlRelation_OneToMany<DataType, Owner> : manage a relationship one-to-many defined between 2 classes (or between 2 tables in database) More...
class | qx::QxSqlRelation_OneToOne< DataType, Owner >
| qx::QxSqlRelation_OneToOne<DataType, Owner> : manage a relationship one-to-one defined between 2 classes (or between 2 tables in database) More...
class | qx::QxSqlRelationLinked
| qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query More...
class | qx::QxSqlRelationParams
| qx::QxSqlRelationParams : define list of parameters to transfer to relationships to manage SQL queries builded by QxOrm library More...
struct | qx::dao::save_mode
| qx::dao::save_mode : to improve performance, if you know that you are just inserting or updating items in database More...
class | qx::QxTimeNeutral
| qx::QxTimeNeutral : helper class to store a time value into database under neutral format (HHMMSS) => cross database compatibility More...
## Namespaces
namespace | qx::dao
| Database communication used by persistence engine (ORM - Object Relational Mapping)
namespace | qx::dao::detail
| Internal helper tools for qx::dao namespace.
namespace | qx::dao::throwable
| Same functions as qx::dao namespace, but throw a qx::dao::sql_error exception when a SQL error occurred (instead of returning a QSqlError instance)
## Files
file | IxDao_Helper.h
| Helper class to communicate with database.
file | IxPersistable.h
| Common interface (abstract class) for persistents classes using QX_PERSISTABLE_HPP() and QX_PERSISTABLE_CPP() macros.
file | IxSqlQueryBuilder.h
| Common interface to build SQL queries to communicate with database.
file | IxSqlRelation.h
| Common interface for all relationships defined between 2 classes (or between 2 tables in database)
file | QxDao.h
| Provide template functions to map C++ class registered into QxOrm context with table database (ORM - Object Relational Mapping)
file | QxDaoAsync.h
| Helper class to execute SQL queries in another thread (asynchronous way) using qx::IxPersistable interface.
file | QxDaoPointer.h
| qx::dao::ptr<T> : provide a classic smart-pointer (like boost::shared_ptr<T> or QSharedPointer<T>) with some features associated with QxDao module of QxOrm library
file | QxDaoStrategy.h
| Class inheritance strategy and database (Concrete Table Inheritance is the default strategy used by QxOrm library)
file | QxDaoThrowable.h
| Same functions as qx::dao namespace, but throw a qx::dao::sql_error exception when a SQL error occurred (instead of returning a QSqlError instance)
file | QxDateNeutral.h
| Helper class to store a date value into database under neutral format (YYYYMMDD) => cross database compatibility.
file | QxDateTimeNeutral.h
| Helper class to store a date-time value into database under neutral format (YYYYMMDDHHMMSS) => cross database compatibility.
file | IxRepository.h
| Common interface for all repositories to provide access to database by introspection using QObject class or qx::IxCollection class.
file | QxRepository.h
| Repository to provide a common interface to communicate with database.
file | QxRepositoryX.h
| List of all repositories registered using qx::register_repository<T> function.
file | QxSession.h
| Define a session to manage automatically database transactions (using C++ RAII)
file | QxSoftDelete.h
| Soft delete (or logical delete) behavior to update a row into database (flag it as deleted) instead of delete it from database.
file | QxSqlDatabase.h
| Define all parameters to connect to database and retrieve a valid connection by thread.
file | IxSqlElement.h
| Common interface for all SQL elements to build SQL query.
file | QxSqlCompare.h
| SQL element to compare value (==, <, >, <=, >=, LIKE, NOT LIKE, etc.)
file | QxSqlElementTemp.h
| Temporary SQL element (need to be cloned to be used)
file | QxSqlExpression.h
| SQL element to build a SQL expression (WHERE, AND, OR, etc.)
file | QxSqlFreeText.h
| Possibility to add free text to SQL query.
file | QxSqlIn.h
| SQL element to verify a list of values (IN, NOT IN, etc.)
file | QxSqlIsBetween.h
| SQL element to verify if a value is included into 2 other values.
file | QxSqlIsNull.h
| SQL element to verify if a value is null or not null (IS NULL, IS NOT NULL)
file | QxSqlLimit.h
| SQL element to limit rows count fetched from database.
file | QxSqlSort.h
| SQL element to sort or to group list of elements fetched from database (ORDER BY, GROUP BY)
file | QxSqlError.h
| Define a SQL error exception and retrieve QSqlError type of Qt library.
file | IxSqlGenerator.h
| Common interface for all SQL generators to build SQL query specific for each database.
file | QxSqlGenerator_MSSQLServer.h
| SQL generator for Microsoft SQL Server database.
file | QxSqlGenerator_MySQL.h
| SQL generator for MySQL database.
file | QxSqlGenerator_Oracle.h
| SQL generator for Oracle database.
file | QxSqlGenerator_PostgreSQL.h
| SQL generator for PostgreSQL database.
file | QxSqlGenerator_SQLite.h
| SQL generator for SQLite database.
file | QxSqlGenerator_Standard.h
| SQL generator to build standard SQL query.
file | QxSqlJoin.h
| Define how to join 2 tables into SQL query (LEFT OUTER JOIN, INNER JOIN, etc...)
file | QxSqlQuery.h
| Define a user SQL query added to default SQL query builded by QxOrm library, and used by qx::dao::xxx functions to filter elements fetched from database.
file | QxSqlQueryBuilder.h
| Concrete SQL query builder by class with a cache mechanism to backup and restore queries already built by the program.
file | QxSqlRelation.h
| Base class for all relationships defined between 2 classes (or between 2 tables in database)
file | QxSqlRelation_ManyToMany.h
| Manage a relationship many-to-many defined between 2 classes (or between 2 tables in database)
file | QxSqlRelation_ManyToOne.h
| Manage a relationship many-to-one defined between 2 classes (or between 2 tables in database)
file | QxSqlRelation_OneToMany.h
| Manage a relationship one-to-many defined between 2 classes (or between 2 tables in database)
file | QxSqlRelation_OneToOne.h
| Manage a relationship one-to-one defined between 2 classes (or between 2 tables in database)
file | QxSqlRelationLinked.h
| Hierarchy of relationships to build SQL query.
file | QxSqlRelationParams.h
| Define list of parameters to transfer to relationships to manage SQL queries builded by QxOrm library.
file | QxSqlSaveMode.h
| To improve performance, if you know that you are just inserting or updating items in database.
file | QxTimeNeutral.h
| Helper class to store a time value into database under neutral format (HHMMSS) => cross database compatibility.
file | QxDaoRepository.h
| Include all headers required to use repository pattern.
## Functions
template<class T >
long | qx::dao::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 context) and filtered by a user SQL query.
template<class T >
QSqlError | qx::dao::count (long &lCount, 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 context) and filtered by a user SQL query.
template<class T >
QSqlError | qx::dao::insert (T &t, QSqlDatabase *pDatabase=NULL)
| Insert an element or a list of elements into database.
template<class T >
QSqlError | qx::dao::save (T &t, QSqlDatabase *pDatabase=NULL)
| Insert (if no exist) or update (if already exist) an element or a list of elements into database.
template<class T >
QSqlError | qx::dao::delete_by_id (T &t, QSqlDatabase *pDatabase=NULL)
| Delete a line (or list of lines) of a table (database) mapped to a C++ object of type T (registered into QxOrm context)
template<class T >
QSqlError | qx::dao::destroy_by_id (T &t, QSqlDatabase *pDatabase=NULL)
| Destroy a line (or list of lines) of a table (database) mapped to a C++ object of type T (registered into QxOrm context), even if a soft delete behavior is defined for class T.
template<class T >
QSqlError | qx::dao::delete_all (QSqlDatabase *pDatabase=NULL)
| Delete all lines of a table (database) mapped to a C++ class T (registered into QxOrm context)
template<class T >
QSqlError | qx::dao::destroy_all (QSqlDatabase *pDatabase=NULL)
| Destroy all lines of a table (database) mapped to a C++ class T (registered into QxOrm context), even if a soft delete behavior is defined for class T.
template<class T >
QSqlError | qx::dao::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 filtered by a user SQL query.
template<class T >
QSqlError | qx::dao::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 filtered by a user SQL query, even if a soft delete behavior is defined for class T.
template<class T >
QSqlError | qx::dao::create_table (QSqlDatabase *pDatabase=NULL)
| Create a table into database (with all columns) mapped to a C++ class T (registered into QxOrm context) : be careful, this function can be used only with a SQLite database to create examples or prototypes; For other databases, it is recommended to use QxEntityEditor application or to manage the database schema with an external tool provided by the SGBD (SQLite Manager for SQLite, pgAdmin for PostgreSQL, MySQL Workbench for MySQL, etc...)
template<class T >
qx_bool | qx::dao::exist (T &t, QSqlDatabase *pDatabase=NULL)
| Search if an element (or list of elements) already exists into database.
template<class T >
QSqlError | qx::dao::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 table in the database (t must have a valid id before to be fetched without error)
template<class T >
QSqlError | qx::dao::fetch_by_id_with_relation (const QStringList &relation, T &t, QSqlDatabase *pDatabase=NULL)
| Fetch an object t (retrieve all its properties) of type T (registered into QxOrm context) mapped to a table in the database (t must have a valid id before to be fetched without error)
template<class T >
QSqlError | qx::dao::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 context) mapped to a table in the database (t must have a valid id before to be fetched without error)
template<class T >
QSqlError | qx::dao::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 registered into QxOrm context) mapped to a table in the database.
template<class T >
QSqlError | qx::dao::fetch_all_with_relation (const QStringList &relation, T &t, QSqlDatabase *pDatabase=NULL)
| Fetch a list of objects (retrieve all elements and properties associated) of type T (container registered into QxOrm context) mapped to a table in the database.
template<class T >
QSqlError | qx::dao::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 T (container registered into QxOrm context) mapped to a table in the database.
template<class T >
QSqlError | qx::dao::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 registered into QxOrm context) mapped to a table in the database and filtered by a user SQL query.
template<class T >
QSqlError | qx::dao::fetch_by_query_with_relation (const QStringList &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 registered into QxOrm context) mapped to a table in the database and filtered by a user SQL query.
template<class T >
QSqlError | qx::dao::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 T (container registered into QxOrm context) mapped to a table in the database and filtered by a user SQL query.
template<class T >
QSqlError | qx::dao::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.
template<class T >
QSqlError | qx::dao::insert_with_relation (const QStringList &relation, T &t, QSqlDatabase *pDatabase=NULL)
| Insert an element and its relationships (or a list of elements + relationships) into database.
template<class T >
QSqlError | qx::dao::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.
template<class T >
QSqlError | qx::dao::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.
template<class T >
QSqlError | qx::dao::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 a user SQL query to the default SQL query builded by QxOrm library)
template<class T >
QSqlError | qx::dao::update_with_relation (const QStringList &relation, T &t, QSqlDatabase *pDatabase=NULL)
| Update an element and its relationships (or a list of elements + relationships) into database.
template<class T >
QSqlError | qx::dao::update_by_query_with_relation (const QStringList &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 a user SQL query to the default SQL query builded by QxOrm library)
template<class T >
QSqlError | qx::dao::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.
template<class T >
QSqlError | qx::dao::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 (adding a user SQL query to the default SQL query builded by QxOrm library)
template<class T >
QSqlError | qx::dao::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 elements + relationships) into database.
template<class T >
QSqlError | qx::dao::save_with_relation (const QStringList &relation, T &t, QSqlDatabase *pDatabase=NULL)
| Insert (if no exist) or update (if already exist) an element and its relationships (or a list of elements + relationships) into database.
template<class T >
QSqlError | qx::dao::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 elements + all relationships) into database.
template<class T >
QSqlError | qx::dao::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 relationships (or a list of elements + all levels of relationships) into database, useful to save a tree structure for example.
template<class T >
QSqlError | qx::dao::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 table in the database (t must have a valid id before to be fetched without error)
template<class T >
QSqlError | qx::dao::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 registered into QxOrm context) mapped to a table in the database.
template<class T >
QSqlError | qx::dao::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 registered into QxOrm context) mapped to a table in the database and filtered by a user SQL query.
template<class T >
QSqlError | qx::dao::update (T &t, QSqlDatabase *pDatabase=NULL, const QStringList &columns=QStringList())
| Update an element or a list of elements into database.
template<class T >
QSqlError | qx::dao::update_by_query (const qx::QxSqlQuery &query, T &t, QSqlDatabase *pDatabase=NULL, const QStringList &columns=QStringList())
| Update an element or a list of elements into database (adding a user SQL query to the default SQL query builded by QxOrm library)
template<class T >
QSqlError | qx::dao::update_optimized (qx::dao::ptr< T > &ptr, QSqlDatabase *pDatabase=NULL)
| Update only modified fields/properties of an element or a list of elements into database (using is dirty pattern and qx::dao::ptr<T> smart-pointer)
template<class T >
QSqlError | qx::dao::update_optimized_by_query (const qx::QxSqlQuery &query, qx::dao::ptr< T > &ptr, QSqlDatabase *pDatabase=NULL)
| Update only modified fields/properties of an element or a list of elements into database (using is dirty pattern and qx::dao::ptr<T> smart-pointer), adding a user SQL query to the default SQL query builded by QxOrm library.
template<class T >
QSqlError | qx::dao::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 type T will be fetched automatically.
template<class T >
void | qx::dao::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)
template<class T >
void | qx::dao::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)
template<class T >
void | qx::dao::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)
template<class T >
void | qx::dao::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)
template<class T >
void | qx::dao::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)
template<class T >
void | qx::dao::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)
template<class T >
void | qx::dao::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)
template<class T >
void | qx::dao::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)
QX_DLL_EXPORT QSqlError | qx::dao::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
QX_DLL_EXPORT QSqlError | qx::dao::call_query_without_prepare (qx::QxSqlQuery &query, QSqlDatabase *pDatabase=NULL)
| qx::dao::call_query_without_prepare function can be used to call a custom SQL query or a stored procedure : same as qx::dao::call_query() function without calling prepare() QSqlQuery class method (can be useful to execute some specific SQL queries)

## Function Documentation

QX_DLL_EXPORT QSqlError qx::dao::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

To get an output value parameter (must be pass as QSql::Out or QSql::InOut) returned by a stored procedure, just call the following method : QVariant qx::QxSqlQuery::boundValue(const QString & sKey) const;.
To iterate over all resultset, just use the following methods :

- long qx::QxSqlQuery::getSqlResultRowCount() const;
- long qx::QxSqlQuery::getSqlResultColumnCount() const;
- QVariant qx::QxSqlQuery::getSqlResultAt(long row, long column) const;
- QVariant qx::QxSqlQuery::getSqlResultAt(long row, const QString & column) const;
- QVector qx::QxSqlQuery::getSqlResultAllColumns() const;
- void qx::QxSqlQuery::dumpSqlResult();

Here is an example of code using qx::dao::call_query function :

    qx_query query("CALL MyStoredProc(:param1, :param2)");
    query.bind(":param1", "myValue1");
    query.bind(":param2", 5024, QSql::InOut);
    QSqlError daoError = qx::dao::call_query(query);
    QVariant vNewValue = query.boundValue(":param2");
    query.dumpSqlResult();

QX_DLL_EXPORT QSqlError qx::dao::call_query_without_prepare | ( | qx::QxSqlQuery & | query,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  |

qx::dao::call_query_without_prepare function can be used to call a custom SQL query or a stored procedure : same as qx::dao::call_query() function without calling prepare() QSqlQuery class method (can be useful to execute some specific SQL queries)

template<class T >

long qx::dao::count | ( | const qx::QxSqlQuery & | query = `qx::QxSqlQuery()`,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Return the number of lines in the table (database) mapped to the C++ class T (registered into QxOrm context) and filtered by a user SQL query.

Parameters:

  query | Define a user SQL query added to default SQL query builded by QxOrm library (optional 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 (optional parameter)

qx::dao::count<T>() execute following SQL query :
SELECT COUNT(*) FROM my_table + WHERE my_query...

Definition at line 97 of file QxDao.h.

template<class T >

QSqlError qx::dao::count | ( | long & | lCount,
|  | const qx::QxSqlQuery & | query = `qx::QxSqlQuery()`,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Return the number of lines in the table (database) mapped to the C++ class T (registered into QxOrm context) and filtered by a user SQL query.

Parameters:

  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 (optional 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 (optional parameter)

qx::dao::count<T>() execute following SQL query :
SELECT COUNT(*) FROM my_table + WHERE my_query...

Definition at line 111 of file QxDao.h.

template<class T >

QSqlError qx::dao::create_table | ( | QSqlDatabase * | pDatabase = `NULL` | ) | `[inline]`

Create a table into database (with all columns) mapped to a C++ class T (registered into QxOrm context) : be careful, this function can be used only with a SQLite database to create examples or prototypes; For other databases, it is recommended to use QxEntityEditor application or to manage the database schema with an external tool provided by the SGBD (SQLite Manager for SQLite, pgAdmin for PostgreSQL, MySQL Workbench for MySQL, etc...)

Parameters:

  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::create_table<T>() execute following SQL query :
CREATE TABLE my_table (my_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, my_column_1 TEXT, my_column_2 TEXT, etc.)

Definition at line 245 of file QxDao.h.

template<class T >

QSqlError qx::dao::delete_all | ( | QSqlDatabase * | pDatabase = `NULL` | ) | `[inline]`

Delete all lines of a table (database) mapped to a C++ class T (registered into QxOrm context)

Parameters:

  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::delete_all<T>() execute following SQL query :
DELETE FROM my_table
If a soft delete behavior is defined for class T, qx::dao::delete_all<T>() execute following SQL query :
UPDATE my_table SET is_deleted='1'

Definition at line 188 of file QxDao.h.

template<class T >

QSqlError qx::dao::delete_by_id | ( | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Delete a line (or list of lines) of a table (database) mapped to a C++ object of type T (registered into QxOrm context)

Parameters:

  t | Element (or list of elements) to be deleted into database
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::delete_by_id<T>() execute following SQL query :
DELETE FROM my_table WHERE my_id = ?
If a soft delete behavior is defined for class T, qx::dao::delete_by_id<T>() execute following SQL query :
UPDATE my_table SET is_deleted='1' WHERE my_id = ?

Definition at line 158 of file QxDao.h.

template<class T >

QSqlError qx::dao::delete_by_query | ( | const qx::QxSqlQuery & | query,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Delete all lines of a table (database) mapped to a C++ class T (registered into QxOrm context) and filtered by a user SQL query.

Parameters:

  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::delete_by_query<T>() execute following SQL query :
DELETE FROM my_table + WHERE my_query...
If a soft delete behavior is defined for class T, qx::dao::delete_by_query<T>() execute following SQL query :
UPDATE my_table SET is_deleted='1' + WHERE my_query...

Definition at line 218 of file QxDao.h.

template<class T >

QSqlError qx::dao::destroy_all | ( | QSqlDatabase * | pDatabase = `NULL` | ) | `[inline]`

Destroy all lines of a table (database) mapped to a C++ class T (registered into QxOrm context), even if a soft delete behavior is defined for class T.

Parameters:

  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::destroy_all<T>() execute following SQL query :
DELETE FROM my_table

Definition at line 201 of file QxDao.h.

template<class T >

QSqlError qx::dao::destroy_by_id | ( | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Destroy a line (or list of lines) of a table (database) mapped to a C++ object of type T (registered into QxOrm context), even if a soft delete behavior is defined for class T.

Parameters:

  t | Element (or list of elements) to be destroyed into database
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::destroy_by_id<T>() execute following SQL query :
DELETE FROM my_table WHERE my_id = ?

Definition at line 172 of file QxDao.h.

template<class T >

QSqlError qx::dao::destroy_by_query | ( | const qx::QxSqlQuery & | query,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Destroy all lines of a table (database) mapped to a C++ class T (registered into QxOrm context) and filtered by a user SQL query, even if a soft delete behavior is defined for class T.

Parameters:

  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::destroy_by_query<T>() execute following SQL query :
DELETE FROM my_table + WHERE my_query...

Definition at line 232 of file QxDao.h.

template<class T >

QSqlError qx::dao::execute_query | ( | qx::QxSqlQuery & | query,
|  | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

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.

Parameters:

  query | Define a custom SQL query or a stored procedure to call
  t | Instance of type T, all columns that can be mapped to this instance will be fetched automatically
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

Definition at line 720 of file QxDao.h.

template<class T >

qx_bool qx::dao::exist | ( | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Search if an element (or list of elements) already exists into database.

Parameters:

  t | Element (or list of elements) to be searched into database
  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 (optional parameter)

Returns:
  Return true if element already exists into database; otherwise return false; if an error occurred, qx_bool object contains a description of database error executing SQL query

qx::dao::exist<T>() execute following SQL query :
SELECT * FROM my_table WHERE my_id = ?

Definition at line 259 of file QxDao.h.

template<class T >

QSqlError qx::dao::fetch_all | ( | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`,
|  | const QStringList & | columns = `QStringList()`
| ) |  | `[inline]`

Fetch a list of objects (retrieve all elements and properties associated) of type T (container registered into QxOrm context) mapped to a table in the database.

Parameters:

  t | Container to be fetched (retrieve all elements and properties associated); t 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 (optional parameter)
  columns | List of database table columns (mapped to properties of C++ class T) to be fetched (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::fetch_all<T>() execute following SQL query :
SELECT * FROM my_table

Definition at line 632 of file QxDao.h.

template<class T >

QSqlError qx::dao::fetch_all_with_all_relation | ( | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Fetch a list of objects (retrieve all elements and properties + all relationships associated) of type T (container registered into QxOrm context) mapped to a table in the database.

Parameters:

  t | Container to be fetched (retrieve all elements and properties + all relationships associated); t 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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::fetch_all_with_all_relation<T>() execute following SQL query :
SELECT * FROM my_table

Definition at line 347 of file QxDao.h.

template<class T >

QSqlError qx::dao::fetch_all_with_relation | ( | const QString & | relation,
|  | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Fetch a list of objects (retrieve all elements and properties associated) of type T (container registered into QxOrm context) mapped to a table in the database.

Parameters:

  relation | List of relationships keys to be fetched (eager fetch instead of default lazy fetch for a relation) : use "|" separator to put many relationships keys into this parameter
  t | Container to be fetched (retrieve all elements and properties associated); t 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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::fetch_all_with_relation<T>() execute following SQL query :
SELECT * FROM my_table

Definition at line 318 of file QxDao.h.

template<class T >

QSqlError qx::dao::fetch_all_with_relation | ( | const QStringList & | relation,
|  | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Fetch a list of objects (retrieve all elements and properties associated) of type T (container registered into QxOrm context) mapped to a table in the database.

Parameters:

  relation | List of relationships keys to be fetched (eager fetch instead of default lazy fetch for a relation)
  t | Container to be fetched (retrieve all elements and properties associated); t 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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::fetch_all_with_relation<T>() execute following SQL query :
SELECT * FROM my_table

Definition at line 333 of file QxDao.h.

template<class T >

QSqlError qx::dao::fetch_by_id | ( | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`,
|  | const QStringList & | columns = `QStringList()`
| ) |  | `[inline]`

Fetch an object t (retrieve all its properties) of type T (registered into QxOrm context) mapped to a table in the database (t must have a valid id before to be fetched without error)

Parameters:

  t | Instance (with a valid id) to be fetched (retrieve all properties from database)
  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 (optional parameter)
  columns | List of database table columns (mapped to properties of C++ class T) to be fetched (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::fetch_by_id<T>() execute following SQL query :
SELECT * FROM my_table WHERE my_id = ?

Definition at line 617 of file QxDao.h.

template<class T >

QSqlError qx::dao::fetch_by_id_with_all_relation | ( | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Fetch an object t (retrieve all its properties and relationships) of type T (registered into QxOrm context) mapped to a table in the database (t must have a valid id before to be fetched without error)

Parameters:

  t | Instance (with a valid id) to be fetched (retrieve all properties and relationships from database)
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::fetch_by_id_with_all_relation<T>() execute following SQL query :
SELECT * FROM my_table WHERE my_id = ?

Definition at line 303 of file QxDao.h.

template<class T >

QSqlError qx::dao::fetch_by_id_with_relation | ( | const QString & | relation,
|  | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Fetch an object t (retrieve all its properties) of type T (registered into QxOrm context) mapped to a table in the database (t must have a valid id before to be fetched without error)

Parameters:

  relation | List of relationships keys to be fetched (eager fetch instead of default lazy fetch for a relation) : use "|" separator to put many relationships keys into this parameter
  t | Instance (with a valid id) to be fetched (retrieve all properties from database)
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::fetch_by_id_with_relation<T>() execute following SQL query :
SELECT * FROM my_table WHERE my_id = ?

Definition at line 274 of file QxDao.h.

template<class T >

QSqlError qx::dao::fetch_by_id_with_relation | ( | const QStringList & | relation,
|  | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Fetch an object t (retrieve all its properties) of type T (registered into QxOrm context) mapped to a table in the database (t must have a valid id before to be fetched without error)

Parameters:

  relation | List of relationships keys to be fetched (eager fetch instead of default lazy fetch for a relation)
  t | Instance (with a valid id) to be fetched (retrieve all properties from database)
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::fetch_by_id_with_relation<T>() execute following SQL query :
SELECT * FROM my_table WHERE my_id = ?

Definition at line 289 of file QxDao.h.

template<class T >

QSqlError qx::dao::fetch_by_query | ( | const qx::QxSqlQuery & | query,
|  | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`,
|  | const QStringList & | columns = `QStringList()`
| ) |  | `[inline]`

Fetch a list of objects (retrieve all elements and properties associated) of type T (container registered into QxOrm context) mapped to a table in the database and filtered by a user SQL query.

Parameters:

  query | Define a user SQL query added to default SQL query builded by QxOrm library
  t | Container to be fetched (retrieve all elements and properties associated); t 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 (optional parameter)
  columns | List of database table columns (mapped to properties of C++ class T) to be fetched (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::fetch_by_query<T>() execute following SQL query :
SELECT * FROM my_table + WHERE my_query...

Definition at line 648 of file QxDao.h.

template<class T >

QSqlError qx::dao::fetch_by_query_with_all_relation | ( | const qx::QxSqlQuery & | query,
|  | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Fetch a list of objects (retrieve all elements and properties + all relationships associated) of type T (container registered into QxOrm context) mapped to a table in the database and filtered by a user SQL query.

Parameters:

  query | Define a user SQL query added to default SQL query builded by QxOrm library
  t | Container to be fetched (retrieve all elements and properties + all relationships associated); t 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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::fetch_by_query_with_all_relation<T>() execute following SQL query :
SELECT * FROM my_table + WHERE my_query...

Definition at line 394 of file QxDao.h.

template<class T >

QSqlError qx::dao::fetch_by_query_with_relation | ( | const QString & | relation,
|  | const qx::QxSqlQuery & | query,
|  | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Fetch a list of objects (retrieve all elements and properties associated) of type T (container registered into QxOrm context) mapped to a table in the database and filtered by a user SQL query.

Parameters:

  relation | List of relationships keys to be fetched (eager fetch instead of default lazy fetch for a relation) : use "|" separator to put many relationships keys into this parameter
  query | Define a user SQL query added to default SQL query builded by QxOrm library
  t | Container to be fetched (retrieve all elements and properties associated); t 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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::fetch_by_query_with_relation<T>() execute following SQL query :
SELECT * FROM my_table + WHERE my_query...

Definition at line 363 of file QxDao.h.

template<class T >

QSqlError qx::dao::fetch_by_query_with_relation | ( | const QStringList & | relation,
|  | const qx::QxSqlQuery & | query,
|  | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Fetch a list of objects (retrieve all elements and properties associated) of type T (container registered into QxOrm context) mapped to a table in the database and filtered by a user SQL query.

Parameters:

  relation | List of relationships keys to be fetched (eager fetch instead of default lazy fetch for a relation)
  query | Define a user SQL query added to default SQL query builded by QxOrm library
  t | Container to be fetched (retrieve all elements and properties associated); t 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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::fetch_by_query_with_relation<T>() execute following SQL query :
SELECT * FROM my_table + WHERE my_query...

Definition at line 379 of file QxDao.h.

template<class T >

QSqlError qx::dao::insert | ( | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Insert an element or a list of elements into database.

Parameters:

  t | Element (or list of elements) to be inserted into database
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::insert<T>() execute following SQL query :
INSERT INTO my_table (my_column_1, my_column_2, etc.) VALUES (?, ?, etc.)

Definition at line 125 of file QxDao.h.

template<class T >

QSqlError qx::dao::insert_with_all_relation | ( | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Insert an element and all its relationships (or a list of elements + all relationships) into database.

Parameters:

  t | Element (or list of elements) to be inserted into database
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::insert_with_all_relation<T>() execute following SQL query :
INSERT INTO my_table (my_column_1, my_column_2, etc.) VALUES (?, ?, etc.)

Definition at line 438 of file QxDao.h.

template<class T >

QSqlError qx::dao::insert_with_relation | ( | const QString & | relation,
|  | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Insert an element and its relationships (or a list of elements + relationships) into database.

Parameters:

  relation | List of relationships keys to be inserted in others tables of database : use "|" separator to put many relationships keys into this parameter
  t | Element (or list of elements) to be inserted into database
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::insert_with_relation<T>() execute following SQL query :
INSERT INTO my_table (my_column_1, my_column_2, etc.) VALUES (?, ?, etc.)

Definition at line 409 of file QxDao.h.

template<class T >

QSqlError qx::dao::insert_with_relation | ( | const QStringList & | relation,
|  | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Insert an element and its relationships (or a list of elements + relationships) into database.

Parameters:

  relation | List of relationships keys to be inserted in others tables of database
  t | Element (or list of elements) to be inserted into database
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::insert_with_relation<T>() execute following SQL query :
INSERT INTO my_table (my_column_1, my_column_2, etc.) VALUES (?, ?, etc.)

Definition at line 424 of file QxDao.h.

template<class T >

void qx::dao::on_after_delete | ( | T * | t,
|  | qx::dao::detail::IxDao_Helper * | dao
| ) |  | `[inline]`

Callback after deleting an object into database (here is an example using QxOrm trigger)

Definition at line 776 of file QxDao.h.

template<class T >

void qx::dao::on_after_fetch | ( | T * | t,
|  | qx::dao::detail::IxDao_Helper * | dao
| ) |  | `[inline]`

Callback after fetching an object from database (here is an example using QxOrm trigger)

Definition at line 784 of file QxDao.h.

template<class T >

void qx::dao::on_after_insert | ( | T * | t,
|  | qx::dao::detail::IxDao_Helper * | dao
| ) |  | `[inline]`

Callback after inserting an object into database (here is an example using QxOrm Trigger)

Definition at line 760 of file QxDao.h.

template<class T >

void qx::dao::on_after_update | ( | T * | t,
|  | qx::dao::detail::IxDao_Helper * | dao
| ) |  | `[inline]`

Callback after updating an object into database (here is an example using QxOrm Trigger)

Definition at line 768 of file QxDao.h.

template<class T >

void qx::dao::on_before_delete | ( | T * | t,
|  | qx::dao::detail::IxDao_Helper * | dao
| ) |  | `[inline]`

Callback before deleting an object into database (here is an example using QxOrm Trigger)

Definition at line 744 of file QxDao.h.

template<class T >

void qx::dao::on_before_fetch | ( | T * | t,
|  | qx::dao::detail::IxDao_Helper * | dao
| ) |  | `[inline]`

Callback before fetching an object from database (here is an example using QxOrm Trigger)

Definition at line 752 of file QxDao.h.

template<class T >

void qx::dao::on_before_insert | ( | T * | t,
|  | qx::dao::detail::IxDao_Helper * | dao
| ) |  | `[inline]`

Callback before inserting an object into database (here is an example using QxOrm Trigger)

Definition at line 728 of file QxDao.h.

template<class T >

void qx::dao::on_before_update | ( | T * | t,
|  | qx::dao::detail::IxDao_Helper * | dao
| ) |  | `[inline]`

Callback before updating an object into database (here is an example using QxOrm Trigger)

Definition at line 736 of file QxDao.h.

template<class T >

QSqlError qx::dao::save | ( | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Insert (if no exist) or update (if already exist) an element or a list of elements into database.

Parameters:

  t | Element (or list of elements) to be inserted (if no exist) or updated (if already exist) into database
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::save<T>() 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.

Definition at line 141 of file QxDao.h.

template<class T >

QSqlError qx::dao::save_with_all_relation | ( | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Insert (if no exist) or update (if already exist) an element and all its relationships (or a list of elements + all relationships) into database.

Parameters:

  t | Element (or list of elements) to be inserted (if no exist) or updated (if already exist) into database
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::save_with_all_relation<T>() 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.

Definition at line 579 of file QxDao.h.

template<class T >

QSqlError qx::dao::save_with_relation | ( | const QString & | relation,
|  | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Insert (if no exist) or update (if already exist) an element and its relationships (or a list of elements + relationships) into database.

Parameters:

  relation | List of relationships keys to be inserted or updated in others tables of database : use "|" separator to put many relationships keys into this parameter
  t | Element (or list of elements) to be inserted (if no exist) or updated (if already exist) into database
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::save_with_relation<T>() 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.

Definition at line 546 of file QxDao.h.

template<class T >

QSqlError qx::dao::save_with_relation | ( | const QStringList & | relation,
|  | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Insert (if no exist) or update (if already exist) an element and its relationships (or a list of elements + relationships) into database.

Parameters:

  relation | List of relationships keys to be inserted or updated in others tables of database
  t | Element (or list of elements) to be inserted (if no exist) or updated (if already exist) into database
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::save_with_relation<T>() 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.

Definition at line 563 of file QxDao.h.

template<class T >

QSqlError qx::dao::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`
| ) |  | `[inline]`

Insert (if no exist) or update (if already exist) recursively an element and all levels of relationships (or a list of elements + all levels of relationships) into database, useful to save a tree structure for example.

Parameters:

  t | Element (or list of elements) to be inserted (if no exist) or updated (if already exist) into database
  eSaveMode | To improve performance, use this parameter to indicate if you just want to insert or update all elements in database
  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 (optional parameter)
  pRelationParams | Keep this parameter as NULL, it is used internally by QxOrm library to iterate over each level of relationship

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::save_with_relation_recursive<T>() 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.
Note : to improve performance, and if you know that you are just inserting or updating items in database, you can use the parameter eSaveMode :

- qx::dao::save_mode::e_check_insert_or_update : check before saving if item already exists in database ;
- qx::dao::save_mode::e_insert_only : only insert items in database (use only 1 SQL query to insert collection of items) ;
- qx::dao::save_mode::e_update_only : only update items in database (use only 1 SQL query to update collection of items).

Definition at line 602 of file QxDao.h.

template<class T >

QSqlError qx::dao::update | ( | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`,
|  | const QStringList & | columns = `QStringList()`
| ) |  | `[inline]`

Update an element or a list of elements into database.

Parameters:

  t | Element (or list of elements) to be updated into database
  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 (optional parameter)
  columns | List of database table columns (mapped to properties of C++ class T) to be updated (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::update<T>() execute following SQL query :
UPDATE my_table SET my_column_1 = ?, my_column_2 = ?, etc.

Definition at line 663 of file QxDao.h.

template<class T >

QSqlError qx::dao::update_by_query | ( | const qx::QxSqlQuery & | query,
|  | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`,
|  | const QStringList & | columns = `QStringList()`
| ) |  | `[inline]`

Update an element or a list of elements into database (adding a user SQL query to the default SQL query builded by QxOrm library)

Parameters:

  query | Define a user SQL query added to default SQL query builded by QxOrm library
  t | Element (or list of elements) to be updated into database
  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 (optional parameter)
  columns | List of database table columns (mapped to properties of C++ class T) to be updated (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::update_by_query<T>() execute following SQL query :
UPDATE my_table SET my_column_1 = ?, my_column_2 = ?, etc. + WHERE my_query...

Definition at line 679 of file QxDao.h.

template<class T >

QSqlError qx::dao::update_by_query_with_all_relation | ( | const qx::QxSqlQuery & | query,
|  | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Update an element and all its relationships (or a list of elements + all relationships) into database (adding a user SQL query to the default SQL query builded by QxOrm library)

Parameters:

  query | Define a user SQL query added to default SQL query builded by QxOrm library
  t | Element (or list of elements) to be updated into database
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::update_by_query_with_all_relation<T>() execute following SQL query :
UPDATE my_table SET my_column_1 = ?, my_column_2 = ?, etc. + WHERE my_query...

Definition at line 529 of file QxDao.h.

template<class T >

QSqlError qx::dao::update_by_query_with_relation | ( | const QString & | relation,
|  | const qx::QxSqlQuery & | query,
|  | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Update an element and its relationships (or a list of elements + relationships) into database (adding a user SQL query to the default SQL query builded by QxOrm library)

Parameters:

  relation | List of relationships keys to be updated in others tables of database : use "|" separator to put many relationships keys into this parameter
  query | Define a user SQL query added to default SQL query builded by QxOrm library
  t | Element (or list of elements) to be updated into database
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::update_by_query_with_relation<T>() execute following SQL query :
UPDATE my_table SET my_column_1 = ?, my_column_2 = ?, etc. + WHERE my_query...

Definition at line 469 of file QxDao.h.

template<class T >

QSqlError qx::dao::update_by_query_with_relation | ( | const QStringList & | relation,
|  | const qx::QxSqlQuery & | query,
|  | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Update an element and its relationships (or a list of elements + relationships) into database (adding a user SQL query to the default SQL query builded by QxOrm library)

Parameters:

  relation | List of relationships keys to be updated in others tables of database
  query | Define a user SQL query added to default SQL query builded by QxOrm library
  t | Element (or list of elements) to be updated into database
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::update_by_query_with_relation<T>() execute following SQL query :
UPDATE my_table SET my_column_1 = ?, my_column_2 = ?, etc. + WHERE my_query...

Definition at line 500 of file QxDao.h.

template<class T >

QSqlError qx::dao::update_optimized | ( | qx::dao::ptr< T > & | ptr,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Update only modified fields/properties of an element or a list of elements into database (using is dirty pattern and qx::dao::ptr<T> smart-pointer)

Parameters:

  ptr | Element (or list of elements) to be updated into database
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::update_optimized<T>() execute following SQL query :
UPDATE my_table SET my_column_1 = ?, my_column_2 = ?, etc.

Definition at line 693 of file QxDao.h.

template<class T >

QSqlError qx::dao::update_optimized_by_query | ( | const qx::QxSqlQuery & | query,
|  | qx::dao::ptr< T > & | ptr,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Update only modified fields/properties of an element or a list of elements into database (using is dirty pattern and qx::dao::ptr<T> smart-pointer), adding a user SQL query to the default SQL query builded by QxOrm library.

Parameters:

  query | Define a user SQL query added to default SQL query builded by QxOrm library
  ptr | Element (or list of elements) to be updated into database
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::update_optimized_by_query<T>() execute following SQL query :
UPDATE my_table SET my_column_1 = ?, my_column_2 = ?, etc. + WHERE my_query...

Definition at line 708 of file QxDao.h.

template<class T >

QSqlError qx::dao::update_with_all_relation | ( | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Update an element and all its relationships (or a list of elements + all relationships) into database.

Parameters:

  t | Element (or list of elements) to be updated into database
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::update_with_all_relation<T>() execute following SQL query :
UPDATE my_table SET my_column_1 = ?, my_column_2 = ?, etc.

Definition at line 514 of file QxDao.h.

template<class T >

QSqlError qx::dao::update_with_relation | ( | const QString & | relation,
|  | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Update an element and its relationships (or a list of elements + relationships) into database.

Parameters:

  relation | List of relationships keys to be updated in others tables of database : use "|" separator to put many relationships keys into this parameter
  t | Element (or list of elements) to be updated into database
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::update_with_relation<T>() execute following SQL query :
UPDATE my_table SET my_column_1 = ?, my_column_2 = ?, etc.

Definition at line 453 of file QxDao.h.

template<class T >

QSqlError qx::dao::update_with_relation | ( | const QStringList & | relation,
|  | T & | t,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline]`

Update an element and its relationships (or a list of elements + relationships) into database.

Parameters:

  relation | List of relationships keys to be updated in others tables of database
  t | Element (or list of elements) to be updated into database
  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 (optional parameter)

Returns:
  Empty QSqlError object (from Qt library) if no error occurred; otherwise QSqlError contains a description of database error executing SQL query

qx::dao::update_with_relation<T>() execute following SQL query :
UPDATE my_table SET my_column_1 = ?, my_column_2 = ?, etc.

Definition at line 484 of file QxDao.h.