QxOrm  1.4.5
C++ Object Relational Mapping library

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

#include <QxRepository.h>

Inheritance diagram for qx::QxRepository< T >:
qx::IxRepository

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,
std::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 84 of file QxRepository.h.


Member Typedef Documentation

template<class T>
typedef qx::QxCollection< type_primary_key, std::shared_ptr<T> > qx::QxRepository< T >::type_collection_boost [private]

Definition at line 254 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 253 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 252 of file QxRepository.h.


Constructor & Destructor Documentation

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

Definition at line 92 of file QxRepository.h.

template<class T>
qx::QxRepository< T >::QxRepository ( ) [inline]

Definition at line 96 of file QxRepository.h.

template<class T>
qx::QxRepository< T >::QxRepository ( const QSqlDatabase &  database) [inline]

Definition at line 97 of file QxRepository.h.

template<class T>
qx::QxRepository< T >::QxRepository ( QxSession pSession) [inline]

Definition at line 98 of file QxRepository.h.

template<class T>
virtual qx::QxRepository< T >::~QxRepository ( ) [inline, virtual]

Definition at line 99 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 270 of file QxRepository.h.

template<class T>
virtual QSqlError qx::QxRepository< T >::_deleteAll ( ) [inline, virtual]

Implements qx::IxRepository.

Definition at line 363 of file QxRepository.h.

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

Implements qx::IxRepository.

Definition at line 348 of file QxRepository.h.

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

Implements qx::IxRepository.

Definition at line 351 of file QxRepository.h.

template<class T>
virtual QSqlError qx::QxRepository< T >::_deleteById ( qx::IxCollection p) [inline, virtual]

Implements qx::IxRepository.

Definition at line 357 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 366 of file QxRepository.h.

template<class T>
virtual QSqlError qx::QxRepository< T >::_destroyAll ( ) [inline, virtual]

Implements qx::IxRepository.

Definition at line 384 of file QxRepository.h.

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

Implements qx::IxRepository.

Definition at line 369 of file QxRepository.h.

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

Implements qx::IxRepository.

Definition at line 372 of file QxRepository.h.

template<class T>
virtual QSqlError qx::QxRepository< T >::_destroyById ( qx::IxCollection p) [inline, virtual]

Implements qx::IxRepository.

Definition at line 378 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 387 of file QxRepository.h.

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

Implements qx::IxRepository.

Definition at line 390 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 396 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 288 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 294 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 273 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 276 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 282 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 300 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 306 of file QxRepository.h.

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

Implements qx::IxRepository.

Definition at line 409 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 312 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 318 of file QxRepository.h.

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

Implements qx::IxRepository.

Definition at line 402 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 336 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 342 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 324 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 330 of file QxRepository.h.

template<class T>
long qx::QxRepository< T >::count ( const qx::QxSqlQuery query = qx::QxSqlQuery()) [inline]

Definition at line 101 of file QxRepository.h.

template<class T>
QSqlError qx::QxRepository< T >::deleteAll ( ) [inline]

Definition at line 198 of file QxRepository.h.

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

Definition at line 178 of file QxRepository.h.

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

Definition at line 191 of file QxRepository.h.

template<class T>
QSqlError qx::QxRepository< T >::deleteByQuery ( const qx::QxSqlQuery query) [inline]

Definition at line 205 of file QxRepository.h.

template<class T>
QSqlError qx::QxRepository< T >::destroyAll ( ) [inline]

Definition at line 232 of file QxRepository.h.

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

Definition at line 212 of file QxRepository.h.

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

Definition at line 225 of file QxRepository.h.

template<class T>
QSqlError qx::QxRepository< T >::destroyByQuery ( const qx::QxSqlQuery query) [inline]

Definition at line 239 of file QxRepository.h.

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

Definition at line 247 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 129 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 104 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 119 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 139 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 414 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 149 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 169 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 159 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: