QxOrm  1.5.0
C++ Object Relational Mapping library

qx::IxRepository : common interface for all repositories to provide access to database by introspection using QObject class or qx::IxCollection class More...

#include <IxRepository.h>

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

List of all members.

Public Member Functions

 IxRepository (bool bRegister, const QString &sKey)
 IxRepository (bool bRegister, const QString &sKey, const QSqlDatabase &database)
 IxRepository (bool bRegister, const QString &sKey, QxSession *pSession)
virtual ~IxRepository ()
QSqlDatabase * database ()
QxSessionsession () const
virtual long _count (const qx::QxSqlQuery &query=qx::QxSqlQuery())=0
virtual void * _fetchById (const QVariant &id, const QStringList &columns=QStringList(), const QStringList &relation=QStringList())=0
virtual QSqlError _fetchById (QObject *p, const QStringList &columns=QStringList(), const QStringList &relation=QStringList())=0
virtual QSqlError _fetchById (qx::IxCollection *p, const QStringList &columns=QStringList(), const QStringList &relation=QStringList())=0
virtual QSqlError _fetchAll (QObject *p, const QStringList &columns=QStringList(), const QStringList &relation=QStringList())=0
virtual QSqlError _fetchAll (qx::IxCollection *p, const QStringList &columns=QStringList(), const QStringList &relation=QStringList())=0
virtual QSqlError _fetchByQuery (const qx::QxSqlQuery &query, QObject *p, const QStringList &columns=QStringList(), const QStringList &relation=QStringList())=0
virtual QSqlError _fetchByQuery (const qx::QxSqlQuery &query, qx::IxCollection *p, const QStringList &columns=QStringList(), const QStringList &relation=QStringList())=0
virtual QSqlError _insert (QObject *p, const QStringList &relation=QStringList())=0
virtual QSqlError _insert (qx::IxCollection *p, const QStringList &relation=QStringList())=0
virtual QSqlError _update (QObject *p, const qx::QxSqlQuery &query=qx::QxSqlQuery(), const QStringList &columns=QStringList(), const QStringList &relation=QStringList())=0
virtual QSqlError _update (qx::IxCollection *p, const qx::QxSqlQuery &query=qx::QxSqlQuery(), const QStringList &columns=QStringList(), const QStringList &relation=QStringList())=0
virtual QSqlError _save (QObject *p, const QStringList &relation=QStringList())=0
virtual QSqlError _save (qx::IxCollection *p, const QStringList &relation=QStringList())=0
virtual QSqlError _deleteById (const QVariant &id)=0
virtual QSqlError _deleteById (QObject *p)=0
virtual QSqlError _deleteById (qx::IxCollection *p)=0
virtual QSqlError _deleteAll ()=0
virtual QSqlError _deleteByQuery (const qx::QxSqlQuery &query)=0
virtual QSqlError _destroyById (const QVariant &id)=0
virtual QSqlError _destroyById (QObject *p)=0
virtual QSqlError _destroyById (qx::IxCollection *p)=0
virtual QSqlError _destroyAll ()=0
virtual QSqlError _destroyByQuery (const qx::QxSqlQuery &query)=0
virtual qx_bool _exist (QObject *p)=0
virtual qx_bool _exist (qx::IxCollection *p)=0
virtual qx::IxCollection_ptr _newCollection () const =0
virtual qx::IxClass_getClass () const =0

Static Public Member Functions

static qx::IxCollection_ptr _fetchAll (const QString &repositoryKey, const QStringList &columns=QStringList(), const QStringList &relation=QStringList())
static qx::IxCollection_ptr _fetchByQuery (const QString &repositoryKey, const qx::QxSqlQuery &query, const QStringList &columns=QStringList(), const QStringList &relation=QStringList())

Protected Attributes

bool m_bRegister
 Register repository into QxRepositoryX collection.
QString m_sKeyRepository
 Repository key used by QxRepositoryX collection.
QSqlDatabase m_database
 Database connection associated to the repository.
QxSessionm_pSession
 Session associated to the repository.

Detailed Description

qx::IxRepository : common interface for all repositories to provide access to database by introspection using QObject class or qx::IxCollection class

There is a type verification at runtime using dynamic_cast function. For example, if you are working with a class named MyType, you can call all methods of qx::IxRepository interface using :

  • MyType * for a single object, if MyType inherits from QObject ;
  • qx::QxCollection< Key, QSharedPointer<MyType> > * for a list of objects, where Key is the primary key type defined for MyType class (long by default).

Note : if a bad type is detected at runtime, an exception of type qx::dao::sql_error is thrown.

Definition at line 73 of file IxRepository.h.


Constructor & Destructor Documentation

qx::IxRepository::IxRepository ( bool  bRegister,
const QString &  sKey 
)
qx::IxRepository::IxRepository ( bool  bRegister,
const QString &  sKey,
const QSqlDatabase &  database 
)
qx::IxRepository::IxRepository ( bool  bRegister,
const QString &  sKey,
QxSession pSession 
)
virtual qx::IxRepository::~IxRepository ( ) [virtual]

Member Function Documentation

virtual long qx::IxRepository::_count ( const qx::QxSqlQuery query = qx::QxSqlQuery()) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_deleteAll ( ) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_deleteById ( const QVariant &  id) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_deleteById ( QObject *  p) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_deleteById ( qx::IxCollection p) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_deleteByQuery ( const qx::QxSqlQuery query) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_destroyAll ( ) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_destroyById ( const QVariant &  id) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_destroyById ( QObject *  p) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_destroyById ( qx::IxCollection p) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_destroyByQuery ( const qx::QxSqlQuery query) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual qx_bool qx::IxRepository::_exist ( QObject *  p) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual qx_bool qx::IxRepository::_exist ( qx::IxCollection p) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_fetchAll ( QObject *  p,
const QStringList &  columns = QStringList(),
const QStringList &  relation = QStringList() 
) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_fetchAll ( qx::IxCollection p,
const QStringList &  columns = QStringList(),
const QStringList &  relation = QStringList() 
) [pure virtual]

Implemented in qx::QxRepository< T >.

static qx::IxCollection_ptr qx::IxRepository::_fetchAll ( const QString &  repositoryKey,
const QStringList &  columns = QStringList(),
const QStringList &  relation = QStringList() 
) [static]
virtual void* qx::IxRepository::_fetchById ( const QVariant &  id,
const QStringList &  columns = QStringList(),
const QStringList &  relation = QStringList() 
) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_fetchById ( QObject *  p,
const QStringList &  columns = QStringList(),
const QStringList &  relation = QStringList() 
) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_fetchById ( qx::IxCollection p,
const QStringList &  columns = QStringList(),
const QStringList &  relation = QStringList() 
) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_fetchByQuery ( const qx::QxSqlQuery query,
QObject *  p,
const QStringList &  columns = QStringList(),
const QStringList &  relation = QStringList() 
) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_fetchByQuery ( const qx::QxSqlQuery query,
qx::IxCollection p,
const QStringList &  columns = QStringList(),
const QStringList &  relation = QStringList() 
) [pure virtual]

Implemented in qx::QxRepository< T >.

static qx::IxCollection_ptr qx::IxRepository::_fetchByQuery ( const QString &  repositoryKey,
const qx::QxSqlQuery query,
const QStringList &  columns = QStringList(),
const QStringList &  relation = QStringList() 
) [static]
virtual qx::IxClass* qx::IxRepository::_getClass ( ) const [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_insert ( QObject *  p,
const QStringList &  relation = QStringList() 
) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_insert ( qx::IxCollection p,
const QStringList &  relation = QStringList() 
) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual qx::IxCollection_ptr qx::IxRepository::_newCollection ( ) const [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_save ( QObject *  p,
const QStringList &  relation = QStringList() 
) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_save ( qx::IxCollection p,
const QStringList &  relation = QStringList() 
) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_update ( QObject *  p,
const qx::QxSqlQuery query = qx::QxSqlQuery(),
const QStringList &  columns = QStringList(),
const QStringList &  relation = QStringList() 
) [pure virtual]

Implemented in qx::QxRepository< T >.

virtual QSqlError qx::IxRepository::_update ( qx::IxCollection p,
const qx::QxSqlQuery query = qx::QxSqlQuery(),
const QStringList &  columns = QStringList(),
const QStringList &  relation = QStringList() 
) [pure virtual]

Implemented in qx::QxRepository< T >.

QSqlDatabase* qx::IxRepository::database ( )
QxSession* qx::IxRepository::session ( ) const

Member Data Documentation

Register repository into QxRepositoryX collection.

Definition at line 78 of file IxRepository.h.

QSqlDatabase qx::IxRepository::m_database [protected]

Database connection associated to the repository.

Definition at line 80 of file IxRepository.h.

Session associated to the repository.

Definition at line 81 of file IxRepository.h.

Repository key used by QxRepositoryX collection.

Definition at line 79 of file IxRepository.h.


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