| QxOrm 1.4.4 C++ Object Relational Mapping library

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

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions
qx::QxModelService< T, S, B > Class Template Reference
QxModelView : All classes registered into QxOrm context can be used with Qt model/view architecture (Qt widgets and/or QML views)

qx::QxModelService<T, S> : provides an easy way to connect your model to the QxService module (all queries are executed over network using client/server communication) More...

`#include <QxModelService.h>`

Inheritance diagram for qx::QxModelService< T, S, B >:

List of all members.

## Public Types
typedef qx::QxModel< T, B > ::type_ptr | type_ptr
typedef qx::QxModel< T, B > ::type_primary_key | type_primary_key
typedef qx::QxModel< T, B > ::type_collection | type_collection
typedef std::shared_ptr < type_collection > | type_collection_ptr
typedef B | type_base_class
## Public Member Functions
| QxModelService (QObject *parent=0)
| QxModelService (qx::IxModel *other, QObject *parent)
virtual | ~QxModelService ()
virtual long | qxCount (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.
virtual QSqlError | qxCount (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.
virtual QSqlError | qxFetchById (const QVariant &id, const QStringList &relation=QStringList(), QSqlDatabase *pDatabase=NULL)
| Clear the model and fetch an object (retrieve all its properties) of type T (registered into QxOrm context) mapped to a table in the database.
virtual QSqlError | qxFetchAll (const QStringList &relation=QStringList(), QSqlDatabase *pDatabase=NULL)
| Clear the model and 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.
virtual QSqlError | qxFetchByQuery (const qx::QxSqlQuery &query, const QStringList &relation=QStringList(), QSqlDatabase *pDatabase=NULL)
| Clear the model and 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.
virtual QSqlError | qxFetchRow (int row, const QStringList &relation=QStringList(), QSqlDatabase *pDatabase=NULL)
| Get an item in the model at line row and fetch all its properties mapped to a table in the database, then all views attached to this model are automatically updated.
virtual QSqlError | qxInsert (const QStringList &relation=QStringList(), QSqlDatabase *pDatabase=NULL)
| Insert all items in the model into database.
virtual QSqlError | qxInsertRow (int row, const QStringList &relation=QStringList(), QSqlDatabase *pDatabase=NULL)
| Insert an item of the model at line row into database.
virtual QSqlError | qxUpdate (const qx::QxSqlQuery &query=qx::QxSqlQuery(), const QStringList &relation=QStringList(), QSqlDatabase *pDatabase=NULL)
| Update all items in the model into database.
virtual QSqlError | qxUpdateRow (int row, const qx::QxSqlQuery &query=qx::QxSqlQuery(), const QStringList &relation=QStringList(), QSqlDatabase *pDatabase=NULL)
| Update an item of the model at line row into database.
virtual QSqlError | qxSave (const QStringList &relation=QStringList(), QSqlDatabase *pDatabase=NULL)
| Save all items (insert or update) in the model into database.
virtual QSqlError | qxSaveRow (int row, const QStringList &relation=QStringList(), QSqlDatabase *pDatabase=NULL)
| Save an item of the model at line row into database.
virtual QSqlError | qxDeleteById (const QVariant &id, QSqlDatabase *pDatabase=NULL)
| Delete a line of a table (database) mapped to a C++ object of type T (registered into QxOrm context), if no error occurred then you should remove row from the model.
virtual QSqlError | qxDeleteAll (QSqlDatabase *pDatabase=NULL)
| Delete all lines of a table (database) mapped to a C++ class T (registered into QxOrm context), if no error occurred then you should clear the model.
virtual QSqlError | qxDeleteByQuery (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, if no error occurred then you should refresh the model.
virtual QSqlError | qxDeleteRow (int row, QSqlDatabase *pDatabase=NULL)
| Delete in database the item at line row in the model, if no error occurred then you should remove row from the model.
virtual QSqlError | qxDestroyById (const QVariant &id, QSqlDatabase *pDatabase=NULL)
| Delete a line of a table (even if a logical delete is defined) mapped to a C++ object of type T (registered into QxOrm context), if no error occurred then you should remove row from the model.
virtual QSqlError | qxDestroyAll (QSqlDatabase *pDatabase=NULL)
| Delete all lines of a table (even if a logical delete is defined) mapped to a C++ class T (registered into QxOrm context), if no error occurred then you should clear the model.
virtual QSqlError | qxDestroyByQuery (const qx::QxSqlQuery &query, QSqlDatabase *pDatabase=NULL)
| Delete all lines of a table (even if a logical delete is defined) mapped to a C++ class T (registered into QxOrm context) and filtered by a user SQL query, if no error occurred then you should refresh the model.
virtual QSqlError | qxDestroyRow (int row, QSqlDatabase *pDatabase=NULL)
| Delete in database (even if a logical delete is defined) the item at line row in the model, if no error occurred then you should remove row from the model.
virtual QSqlError | qxExecuteQuery (qx::QxSqlQuery &query, QSqlDatabase *pDatabase=NULL)
virtual qx_bool | qxExist (const QVariant &id, QSqlDatabase *pDatabase=NULL)
virtual qx::QxInvalidValueX | qxValidate (const QStringList &groups=QStringList())
virtual qx::QxInvalidValueX | qxValidateRow (int row, const QStringList &groups=QStringList())
## Protected Member Functions
virtual QVariant | getRelationshipValues_Helper (int row, const QString &relation, bool bLoadFromDatabase, const QString &sAppendRelations)

## Detailed Description

### template<class T, class S, class B = qx::IxModel>
class qx::QxModelService< T, S, B >

qx::QxModelService<T, S> : provides an easy way to connect your model to the QxService module (all queries are executed over network using client/server communication)

T template parameter is a persistent class registered into QxOrm context S template parameter is a service class generated by QxEntityEditor (or your own service class providing all methods)

Definition at line 58 of file QxModelService.h.

## Member Typedef Documentation

template<class T , class S , class B = qx::IxModel>

typedef B qx::QxModelService< T, S, B >::type_base_class

Reimplemented from qx::QxModel< T, B >.

Definition at line 67 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

typedef qx::QxModel<T, B>::type_collection qx::QxModelService< T, S, B >::type_collection

Reimplemented from qx::QxModel< T, B >.

Definition at line 65 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

typedef std::shared_ptr<type_collection> qx::QxModelService< T, S, B >::type_collection_ptr

Definition at line 66 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

typedef qx::QxModel<T, B>::type_primary_key qx::QxModelService< T, S, B >::type_primary_key

Reimplemented from qx::QxModel< T, B >.

Definition at line 64 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

typedef qx::QxModel<T, B>::type_ptr qx::QxModelService< T, S, B >::type_ptr

Reimplemented from qx::QxModel< T, B >.

Definition at line 63 of file QxModelService.h.

## Constructor & Destructor Documentation

template<class T , class S , class B = qx::IxModel>

qx::QxModelService< T, S, B >::QxModelService | ( | QObject * | parent = `0` | ) | `[inline]`

Definition at line 71 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

qx::QxModelService< T, S, B >::QxModelService | ( | qx::IxModel * | other,
|  | QObject * | parent
| ) |  | `[inline]`

Definition at line 72 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual qx::QxModelService< T, S, B >::~QxModelService | ( |  | ) | `[inline, virtual]`

Definition at line 73 of file QxModelService.h.

## Member Function Documentation

template<class T , class S , class B = qx::IxModel>

virtual QVariant qx::QxModelService< T, S, B >::getRelationshipValues_Helper | ( | int | row,
|  | const QString & | relation,
|  | bool | bLoadFromDatabase,
|  | const QString & | sAppendRelations
| ) |  | `[inline, protected, virtual]`

Reimplemented from qx::QxModel< T, B >.

Definition at line 388 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual long qx::QxModelService< T, S, B >::qxCount | ( | const qx::QxSqlQuery & | query = `qx::QxSqlQuery()`,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline, virtual]`

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)

Reimplemented from qx::QxModel< T, B >.

Definition at line 75 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual QSqlError qx::QxModelService< T, S, B >::qxCount | ( | long & | lCount,
|  | const qx::QxSqlQuery & | query = `qx::QxSqlQuery()`,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline, virtual]`

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)

Reimplemented from qx::QxModel< T, B >.

Definition at line 82 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual QSqlError qx::QxModelService< T, S, B >::qxDeleteAll | ( | QSqlDatabase * | pDatabase = `NULL` | ) | `[inline, virtual]`

Delete all lines of a table (database) mapped to a C++ class T (registered into QxOrm context), if no error occurred then you should clear the model.

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

Reimplemented from qx::QxModel< T, B >.

Definition at line 267 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual QSqlError qx::QxModelService< T, S, B >::qxDeleteById | ( | const QVariant & | id,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline, virtual]`

Delete a line of a table (database) mapped to a C++ object of type T (registered into QxOrm context), if no error occurred then you should remove row from the model.

Parameters:

  id | Row id to be deleted 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

Reimplemented from qx::QxModel< T, B >.

Definition at line 254 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual QSqlError qx::QxModelService< T, S, B >::qxDeleteByQuery | ( | const qx::QxSqlQuery & | query,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline, virtual]`

Delete all lines of a table (database) mapped to a C++ class T (registered into QxOrm context) and filtered by a user SQL query, if no error occurred then you should refresh the model.

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

Reimplemented from qx::QxModel< T, B >.

Definition at line 275 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual QSqlError qx::QxModelService< T, S, B >::qxDeleteRow | ( | int | row,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline, virtual]`

Delete in database the item at line row in the model, if no error occurred then you should remove row from the model.

Parameters:

  row | Delete in database the item in the model at line row
  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

Reimplemented from qx::QxModel< T, B >.

Definition at line 283 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual QSqlError qx::QxModelService< T, S, B >::qxDestroyAll | ( | QSqlDatabase * | pDatabase = `NULL` | ) | `[inline, virtual]`

Delete all lines of a table (even if a logical delete is defined) mapped to a C++ class T (registered into QxOrm context), if no error occurred then you should clear the model.

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

Reimplemented from qx::QxModel< T, B >.

Definition at line 307 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual QSqlError qx::QxModelService< T, S, B >::qxDestroyById | ( | const QVariant & | id,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline, virtual]`

Delete a line of a table (even if a logical delete is defined) mapped to a C++ object of type T (registered into QxOrm context), if no error occurred then you should remove row from the model.

Parameters:

  id | Row id to be deleted 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

Reimplemented from qx::QxModel< T, B >.

Definition at line 294 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual QSqlError qx::QxModelService< T, S, B >::qxDestroyByQuery | ( | const qx::QxSqlQuery & | query,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline, virtual]`

Delete all lines of a table (even if a logical delete is defined) mapped to a C++ class T (registered into QxOrm context) and filtered by a user SQL query, if no error occurred then you should refresh the model.

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

Reimplemented from qx::QxModel< T, B >.

Definition at line 315 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual QSqlError qx::QxModelService< T, S, B >::qxDestroyRow | ( | int | row,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline, virtual]`

Delete in database (even if a logical delete is defined) the item at line row in the model, if no error occurred then you should remove row from the model.

Parameters:

  row | Delete in database the item in the model at line row
  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

Reimplemented from qx::QxModel< T, B >.

Definition at line 323 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual QSqlError qx::QxModelService< T, S, B >::qxExecuteQuery | ( | qx::QxSqlQuery & | query,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline, virtual]`

Reimplemented from qx::QxModel< T, B >.

Definition at line 334 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual qx_bool qx::QxModelService< T, S, B >::qxExist | ( | const QVariant & | id,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline, virtual]`

Reimplemented from qx::QxModel< T, B >.

Definition at line 352 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual QSqlError qx::QxModelService< T, S, B >::qxFetchAll | ( | const QStringList & | relation = `QStringList()`,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline, virtual]`

Clear the model and 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
  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

Reimplemented from qx::QxModel< T, B >.

Definition at line 111 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual QSqlError qx::QxModelService< T, S, B >::qxFetchById | ( | const QVariant & | id,
|  | const QStringList & | relation = `QStringList()`,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline, virtual]`

Clear the model and fetch an object (retrieve all its properties) of type T (registered into QxOrm context) mapped to a table in the database.

Parameters:

  id | Row id to be fetched (retrieve all properties from database)
  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
  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

Reimplemented from qx::QxModel< T, B >.

Definition at line 90 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual QSqlError qx::QxModelService< T, S, B >::qxFetchByQuery | ( | const qx::QxSqlQuery & | query,
|  | const QStringList & | relation = `QStringList()`,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline, virtual]`

Clear the model and 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
  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
  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

Reimplemented from qx::QxModel< T, B >.

Definition at line 129 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual QSqlError qx::QxModelService< T, S, B >::qxFetchRow | ( | int | row,
|  | const QStringList & | relation = `QStringList()`,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline, virtual]`

Get an item in the model at line row and fetch all its properties mapped to a table in the database, then all views attached to this model are automatically updated.

Parameters:

  row | Get an item in the model at line row
  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
  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

Reimplemented from qx::QxModel< T, B >.

Definition at line 147 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual QSqlError qx::QxModelService< T, S, B >::qxInsert | ( | const QStringList & | relation = `QStringList()`,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline, virtual]`

Insert all items in the model 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
  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

Reimplemented from qx::QxModel< T, B >.

Definition at line 164 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual QSqlError qx::QxModelService< T, S, B >::qxInsertRow | ( | int | row,
|  | const QStringList & | relation = `QStringList()`,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline, virtual]`

Insert an item of the model at line row into database.

Parameters:

  row | Insert an item in the model at line row
  relation | List of relationships keys to be inserted in others tables of database : use "|" separator to put many relationships keys into this parameter
  pDatabase | Connection to database (you can manage your own connection pool for example, you can also define a transaction, etc.); if NULL, a valid connection for the current thread is provided by qx::QxSqlDatabase singleton class (optional parameter)

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

Reimplemented from qx::QxModel< T, B >.

Definition at line 180 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual QSqlError qx::QxModelService< T, S, B >::qxSave | ( | const QStringList & | relation = `QStringList()`,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline, virtual]`

Save all items (insert or update) in the model 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
  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

Reimplemented from qx::QxModel< T, B >.

Definition at line 224 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual QSqlError qx::QxModelService< T, S, B >::qxSaveRow | ( | int | row,
|  | const QStringList & | relation = `QStringList()`,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline, virtual]`

Save an item of the model at line row into database.

Parameters:

  row | Save an item (insert or update) in the model at line row
  relation | List of relationships keys to be inserted in others tables of database : use "|" separator to put many relationships keys into this parameter
  pDatabase | Connection to database (you can manage your own connection pool for example, you can also define a transaction, etc.); if NULL, a valid connection for the current thread is provided by qx::QxSqlDatabase singleton class (optional parameter)

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

Reimplemented from qx::QxModel< T, B >.

Definition at line 240 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual QSqlError qx::QxModelService< T, S, B >::qxUpdate | ( | const qx::QxSqlQuery & | query = `qx::QxSqlQuery()`,
|  | const QStringList & | relation = `QStringList()`,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline, virtual]`

Update all items in the model into database.

Parameters:

  query | Define a user SQL query added to default SQL query builded by QxOrm library
  relation | List of relationships keys to be inserted in others tables of database : use "|" separator to put many relationships keys into this parameter
  pDatabase | Connection to database (you can manage your own connection pool for example, you can also define a transaction, etc.); if NULL, a valid connection for the current thread is provided by qx::QxSqlDatabase singleton class (optional parameter)

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

Reimplemented from qx::QxModel< T, B >.

Definition at line 194 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual QSqlError qx::QxModelService< T, S, B >::qxUpdateRow | ( | int | row,
|  | const qx::QxSqlQuery & | query = `qx::QxSqlQuery()`,
|  | const QStringList & | relation = `QStringList()`,
|  | QSqlDatabase * | pDatabase = `NULL`
| ) |  | `[inline, virtual]`

Update an item of the model at line row into database.

Parameters:

  row | Update an item in the model at line row
  query | Define a user SQL query added to default SQL query builded by QxOrm library
  relation | List of relationships keys to be inserted in others tables of database : use "|" separator to put many relationships keys into this parameter
  pDatabase | Connection to database (you can manage your own connection pool for example, you can also define a transaction, etc.); if NULL, a valid connection for the current thread is provided by qx::QxSqlDatabase singleton class (optional parameter)

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

Reimplemented from qx::QxModel< T, B >.

Definition at line 210 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual qx::QxInvalidValueX qx::QxModelService< T, S, B >::qxValidate | ( | const QStringList & | groups = `QStringList()` | ) | `[inline, virtual]`

Reimplemented from qx::QxModel< T, B >.

Definition at line 364 of file QxModelService.h.

template<class T , class S , class B = qx::IxModel>

virtual qx::QxInvalidValueX qx::QxModelService< T, S, B >::qxValidateRow | ( | int | row,
|  | const QStringList & | groups = `QStringList()`
| ) |  | `[inline, virtual]`

Reimplemented from qx::QxModel< T, B >.

Definition at line 374 of file QxModelService.h.

The documentation for this class was generated from the following file:

- C:/Dvlp/_Perso/QxOrm/include/QxModelView/QxModelService.h