| QxOrm 1.2.4 C++ Object Relational Mapping library

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

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

Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Friends
qx::QxRepository< T > Class Template Reference
QxDao : QxOrm library database communication used by persistence engine (ORM - Object Relational Mapping)

qx::QxRepository<T> : repository to provide a common interface to communicate with database More...

`#include <QxRepository.h>`

Inheritance diagram for qx::QxRepository< T >:

List of all members.

## Classes
struct | qxVerifyPointer
struct | qxVerifyPointer< true, dummy >
## Public Member Functions
| QxRepository ()
| QxRepository (const QSqlDatabase &database)
| QxRepository (QxSession *pSession)
virtual | ~QxRepository ()
long | count (const qx::QxSqlQuery &query=qx::QxSqlQuery())
T * | fetchById (const QVariant &id, const QStringList &columns=QStringList(), const QStringList &relation=QStringList())
template<class U >
QSqlError | fetchById (U &u, const QStringList &columns=QStringList(), const QStringList &relation=QStringList())
template<class U >
QSqlError | fetchAll (U &u, const QStringList &columns=QStringList(), const QStringList &relation=QStringList())
template<class U >
QSqlError | fetchByQuery (const qx::QxSqlQuery &query, U &u, const QStringList &columns=QStringList(), const QStringList &relation=QStringList())
template<class U >
QSqlError | insert (U &u, const QStringList &relation=QStringList())
template<class U >
QSqlError | update (U &u, const qx::QxSqlQuery &query=qx::QxSqlQuery(), const QStringList &columns=QStringList(), const QStringList &relation=QStringList())
template<class U >
QSqlError | save (U &u, const QStringList &relation=QStringList())
QSqlError | deleteById (const QVariant &id)
template<class U >
QSqlError | deleteById (U &u)
QSqlError | deleteAll ()
QSqlError | deleteByQuery (const qx::QxSqlQuery &query)
QSqlError | destroyById (const QVariant &id)
template<class U >
QSqlError | destroyById (U &u)
QSqlError | destroyAll ()
QSqlError | destroyByQuery (const qx::QxSqlQuery &query)
template<class U >
qx_bool | exist (U &u)
virtual long | _count (const qx::QxSqlQuery &query=qx::QxSqlQuery())
virtual void * | _fetchById (const QVariant &id, const QStringList &columns=QStringList(), const QStringList &relation=QStringList())
virtual QSqlError | _fetchById (QObject *p, const QStringList &columns=QStringList(), const QStringList &relation=QStringList())
virtual QSqlError | _fetchById (qx::IxCollection *p, const QStringList &columns=QStringList(), const QStringList &relation=QStringList())
virtual QSqlError | _fetchAll (QObject *p, const QStringList &columns=QStringList(), const QStringList &relation=QStringList())
virtual QSqlError | _fetchAll (qx::IxCollection *p, const QStringList &columns=QStringList(), const QStringList &relation=QStringList())
virtual QSqlError | _fetchByQuery (const qx::QxSqlQuery &query, QObject *p, const QStringList &columns=QStringList(), const QStringList &relation=QStringList())
virtual QSqlError | _fetchByQuery (const qx::QxSqlQuery &query, qx::IxCollection *p, const QStringList &columns=QStringList(), const QStringList &relation=QStringList())
virtual QSqlError | _insert (QObject *p, const QStringList &relation=QStringList())
virtual QSqlError | _insert (qx::IxCollection *p, const QStringList &relation=QStringList())
virtual QSqlError | _update (QObject *p, const qx::QxSqlQuery &query=qx::QxSqlQuery(), const QStringList &columns=QStringList(), const QStringList &relation=QStringList())
virtual QSqlError | _update (qx::IxCollection *p, const qx::QxSqlQuery &query=qx::QxSqlQuery(), const QStringList &columns=QStringList(), const QStringList &relation=QStringList())
virtual QSqlError | _save (QObject *p, const QStringList &relation=QStringList())
virtual QSqlError | _save (qx::IxCollection *p, const QStringList &relation=QStringList())
virtual QSqlError | _deleteById (const QVariant &id)
virtual QSqlError | _deleteById (QObject *p)
virtual QSqlError | _deleteById (qx::IxCollection *p)
virtual QSqlError | _deleteAll ()
virtual QSqlError | _deleteByQuery (const qx::QxSqlQuery &query)
virtual QSqlError | _destroyById (const QVariant &id)
virtual QSqlError | _destroyById (QObject *p)
virtual QSqlError | _destroyById (qx::IxCollection *p)
virtual QSqlError | _destroyAll ()
virtual QSqlError | _destroyByQuery (const qx::QxSqlQuery &query)
virtual qx_bool | _exist (QObject *p)
virtual qx_bool | _exist (qx::IxCollection *p)
virtual qx::IxCollection_ptr | _newCollection () const
virtual qx::IxClass * | _getClass () const
## Static Public Member Functions
static T * | getById (const QVariant &id, const QStringList &columns=QStringList(), const QStringList &relation=QStringList())
## Private Types
typedef qx::trait::get_primary_key< T > ::type | type_primary_key
typedef qx::QxCollection < type_primary_key, QSharedPointer< T > > | type_collection_qt
typedef qx::QxCollection < type_primary_key, boost::shared_ptr< T > > | type_collection_boost
## Private Member Functions
| QxRepository (const QString &sKey)
## Friends
template<class U >
void | register_repository (const QString &sKey)

## Detailed Description

### template<class T>
class qx::QxRepository< T >

qx::QxRepository<T> : repository to provide a common interface to communicate with database

Definition at line 69 of file QxRepository.h.

## Member Typedef Documentation

template<class T>

typedef qx::QxCollection< type_primary_key, boost::shared_ptr<T> > qx::QxRepository< T >::type_collection_boost`[private]`

Definition at line 239 of file QxRepository.h.

template<class T>

typedef qx::QxCollection< type_primary_key, QSharedPointer<T> > qx::QxRepository< T >::type_collection_qt`[private]`

Definition at line 238 of file QxRepository.h.

template<class T>

typedef qx::trait::get_primary_key<T>::type qx::QxRepository< T >::type_primary_key`[private]`

Definition at line 237 of file QxRepository.h.

## Constructor & Destructor Documentation

template<class T>

qx::QxRepository< T >::QxRepository | ( | const QString & | sKey | ) | `[inline, private]`

Definition at line 77 of file QxRepository.h.

template<class T>

qx::QxRepository< T >::QxRepository | ( |  | ) | `[inline]`

Definition at line 81 of file QxRepository.h.

template<class T>

qx::QxRepository< T >::QxRepository | ( | const QSqlDatabase & | database | ) | `[inline]`

Definition at line 82 of file QxRepository.h.

template<class T>

qx::QxRepository< T >::QxRepository | ( | QxSession * | pSession | ) | `[inline]`

Definition at line 83 of file QxRepository.h.

template<class T>

virtual qx::QxRepository< T >::~QxRepository | ( |  | ) | `[inline, virtual]`

Definition at line 84 of file QxRepository.h.

## Member Function Documentation

template<class T>

virtual long qx::QxRepository< T >::_count | ( | const qx::QxSqlQuery & | query = `qx::QxSqlQuery()` | ) | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 251 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_deleteAll | ( |  | ) | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 358 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_deleteById | ( | const QVariant & | id | ) | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 341 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_deleteById | ( | QObject * | p | ) | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 344 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_deleteById | ( | qx::IxCollection * | p | ) | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 350 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_deleteByQuery | ( | const qx::QxSqlQuery & | query | ) | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 361 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_destroyAll | ( |  | ) | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 381 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_destroyById | ( | const QVariant & | id | ) | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 364 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_destroyById | ( | QObject * | p | ) | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 367 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_destroyById | ( | qx::IxCollection * | p | ) | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 373 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_destroyByQuery | ( | const qx::QxSqlQuery & | query | ) | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 384 of file QxRepository.h.

template<class T>

virtual qx_bool qx::QxRepository< T >::_exist | ( | QObject * | p | ) | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 387 of file QxRepository.h.

template<class T>

virtual qx_bool qx::QxRepository< T >::_exist | ( | qx::IxCollection * | p | ) | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 393 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_fetchAll | ( | QObject * | p,
|  | const QStringList & | columns = `QStringList()`,
|  | const QStringList & | relation = `QStringList()`
| ) |  | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 271 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_fetchAll | ( | qx::IxCollection * | p,
|  | const QStringList & | columns = `QStringList()`,
|  | const QStringList & | relation = `QStringList()`
| ) |  | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 277 of file QxRepository.h.

template<class T>

virtual void* qx::QxRepository< T >::_fetchById | ( | const QVariant & | id,
|  | const QStringList & | columns = `QStringList()`,
|  | const QStringList & | relation = `QStringList()`
| ) |  | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 254 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_fetchById | ( | QObject * | p,
|  | const QStringList & | columns = `QStringList()`,
|  | const QStringList & | relation = `QStringList()`
| ) |  | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 257 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_fetchById | ( | qx::IxCollection * | p,
|  | const QStringList & | columns = `QStringList()`,
|  | const QStringList & | relation = `QStringList()`
| ) |  | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 263 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_fetchByQuery | ( | const qx::QxSqlQuery & | query,
|  | QObject * | p,
|  | const QStringList & | columns = `QStringList()`,
|  | const QStringList & | relation = `QStringList()`
| ) |  | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 285 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_fetchByQuery | ( | const qx::QxSqlQuery & | query,
|  | qx::IxCollection * | p,
|  | const QStringList & | columns = `QStringList()`,
|  | const QStringList & | relation = `QStringList()`
| ) |  | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 291 of file QxRepository.h.

template<class T>

virtual qx::IxClass* qx::QxRepository< T >::_getClass | ( |  | ) | const`[inline, virtual]`

Implements qx::IxRepository.

Definition at line 408 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_insert | ( | QObject * | p,
|  | const QStringList & | relation = `QStringList()`
| ) |  | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 299 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_insert | ( | qx::IxCollection * | p,
|  | const QStringList & | relation = `QStringList()`
| ) |  | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 305 of file QxRepository.h.

template<class T>

virtual qx::IxCollection_ptr qx::QxRepository< T >::_newCollection | ( |  | ) | const`[inline, virtual]`

Implements qx::IxRepository.

Definition at line 401 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_save | ( | QObject * | p,
|  | const QStringList & | relation = `QStringList()`
| ) |  | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 327 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_save | ( | qx::IxCollection * | p,
|  | const QStringList & | relation = `QStringList()`
| ) |  | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 333 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_update | ( | QObject * | p,
|  | const qx::QxSqlQuery & | query = `qx::QxSqlQuery()`,
|  | const QStringList & | columns = `QStringList()`,
|  | const QStringList & | relation = `QStringList()`
| ) |  | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 313 of file QxRepository.h.

template<class T>

virtual QSqlError qx::QxRepository< T >::_update | ( | qx::IxCollection * | p,
|  | const qx::QxSqlQuery & | query = `qx::QxSqlQuery()`,
|  | const QStringList & | columns = `QStringList()`,
|  | const QStringList & | relation = `QStringList()`
| ) |  | `[inline, virtual]`

Implements qx::IxRepository.

Definition at line 319 of file QxRepository.h.

template<class T>

long qx::QxRepository< T >::count | ( | const qx::QxSqlQuery & | query = `qx::QxSqlQuery()` | ) | `[inline]`

Definition at line 86 of file QxRepository.h.

template<class T>

QSqlError qx::QxRepository< T >::deleteAll | ( |  | ) | `[inline]`

Definition at line 183 of file QxRepository.h.

template<class T>

QSqlError qx::QxRepository< T >::deleteById | ( | const QVariant & | id | ) | `[inline]`

Definition at line 163 of file QxRepository.h.

template<class T>
template<class U >

QSqlError qx::QxRepository< T >::deleteById | ( | U & | u | ) | `[inline]`

Definition at line 176 of file QxRepository.h.

template<class T>

QSqlError qx::QxRepository< T >::deleteByQuery | ( | const qx::QxSqlQuery & | query | ) | `[inline]`

Definition at line 190 of file QxRepository.h.

template<class T>

QSqlError qx::QxRepository< T >::destroyAll | ( |  | ) | `[inline]`

Definition at line 217 of file QxRepository.h.

template<class T>

QSqlError qx::QxRepository< T >::destroyById | ( | const QVariant & | id | ) | `[inline]`

Definition at line 197 of file QxRepository.h.

template<class T>
template<class U >

QSqlError qx::QxRepository< T >::destroyById | ( | U & | u | ) | `[inline]`

Definition at line 210 of file QxRepository.h.

template<class T>

QSqlError qx::QxRepository< T >::destroyByQuery | ( | const qx::QxSqlQuery & | query | ) | `[inline]`

Definition at line 224 of file QxRepository.h.

template<class T>
template<class U >

qx_bool qx::QxRepository< T >::exist | ( | U & | u | ) | `[inline]`

Definition at line 232 of file QxRepository.h.

template<class T>
template<class U >

QSqlError qx::QxRepository< T >::fetchAll | ( | U & | u,
|  | const QStringList & | columns = `QStringList()`,
|  | const QStringList & | relation = `QStringList()`
| ) |  | `[inline]`

Definition at line 114 of file QxRepository.h.

template<class T>

T* qx::QxRepository< T >::fetchById | ( | const QVariant & | id,
|  | const QStringList & | columns = `QStringList()`,
|  | const QStringList & | relation = `QStringList()`
| ) |  | `[inline]`

Definition at line 89 of file QxRepository.h.

template<class T>
template<class U >

QSqlError qx::QxRepository< T >::fetchById | ( | U & | u,
|  | const QStringList & | columns = `QStringList()`,
|  | const QStringList & | relation = `QStringList()`
| ) |  | `[inline]`

Definition at line 104 of file QxRepository.h.

template<class T>
template<class U >

QSqlError qx::QxRepository< T >::fetchByQuery | ( | const qx::QxSqlQuery & | query,
|  | U & | u,
|  | const QStringList & | columns = `QStringList()`,
|  | const QStringList & | relation = `QStringList()`
| ) |  | `[inline]`

Definition at line 124 of file QxRepository.h.

template<class T>

static T* qx::QxRepository< T >::getById | ( | const QVariant & | id,
|  | const QStringList & | columns = `QStringList()`,
|  | const QStringList & | relation = `QStringList()`
| ) |  | `[inline, static]`

Definition at line 413 of file QxRepository.h.

template<class T>
template<class U >

QSqlError qx::QxRepository< T >::insert | ( | U & | u,
|  | const QStringList & | relation = `QStringList()`
| ) |  | `[inline]`

Definition at line 134 of file QxRepository.h.

template<class T>
template<class U >

QSqlError qx::QxRepository< T >::save | ( | U & | u,
|  | const QStringList & | relation = `QStringList()`
| ) |  | `[inline]`

Definition at line 154 of file QxRepository.h.

template<class T>
template<class U >

QSqlError qx::QxRepository< T >::update | ( | U & | u,
|  | const qx::QxSqlQuery & | query = `qx::QxSqlQuery()`,
|  | const QStringList & | columns = `QStringList()`,
|  | const QStringList & | relation = `QStringList()`
| ) |  | `[inline]`

Definition at line 144 of file QxRepository.h.

## Friends And Related Function Documentation

template<class T>
template<class U >

void register_repository | ( | const QString & | sKey | ) | `[friend]`

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

- D:/Dvlp/_Perso/QxOrm/include/QxDao/QxRepository/QxRepository.h