![]() |
QxOrm
1.4.3
C++ Object Relational Mapping library
|
qx::IxSqlRelation : common interface for all relationships defined between 2 classes (or between 2 tables in database) More...
#include <IxSqlRelation.h>
Public Types | |
enum | relation_type { no_relation, one_to_one, one_to_many, many_to_one, many_to_many } |
typedef QxCollection< QString, IxDataMember * > | type_lst_data_member |
typedef qx_shared_ptr < type_lst_data_member > | type_lst_data_member_ptr |
Public Member Functions | |
IxSqlRelation (IxDataMember *p) | |
virtual | ~IxSqlRelation ()=0 |
QxCollection< QString, IxDataMember * > * | getLstDataMember () const |
IxSqlRelationX * | getLstRelation () const |
void | setSqlJoinType (qx::dao::sql_join::join_type e) |
qx::dao::sql_join::join_type | getSqlJoinType () const |
relation_type | getRelationType () const |
IxClass * | getClass () const |
IxClass * | getClassOwner () const |
IxDataMember * | getDataMember () const |
IxDataMemberX * | getDataMemberX () const |
IxDataMember * | getDataId () const |
IxDataMember * | getDataIdOwner () const |
QString | getKey () const |
long | getDataCount () const |
long | getRelationCount () const |
IxDataMember * | getDataByKey (const QString &sKey) const |
IxDataMember * | nextData (long &lIndex) const |
IxSqlRelation * | nextRelation (long &lIndex) const |
QString | table () const |
QString | tableAlias (QxSqlRelationParams ¶ms) const |
QString | tableAliasOwner (QxSqlRelationParams ¶ms) const |
QString | getSqlJoin (qx::dao::sql_join::join_type e=qx::dao::sql_join::no_join) const |
bool | traceSqlQuery () const |
virtual void | init () |
virtual QString | getDescription () const =0 |
virtual QString | getExtraTable () const =0 |
virtual QString | createExtraTable () const =0 |
virtual bool | getCartesianProduct () const =0 |
virtual QVariant | getIdFromQuery (bool bEager, QxSqlRelationParams ¶ms) const =0 |
virtual void | updateOffset (bool bEager, QxSqlRelationParams ¶ms) const =0 |
virtual void | createTable (QxSqlRelationParams ¶ms) const =0 |
virtual void | lazySelect (QxSqlRelationParams ¶ms) const =0 |
virtual void | eagerSelect (QxSqlRelationParams ¶ms) const =0 |
virtual void | lazyFrom (QxSqlRelationParams ¶ms) const =0 |
virtual void | eagerFrom (QxSqlRelationParams ¶ms) const =0 |
virtual void | lazyJoin (QxSqlRelationParams ¶ms) const =0 |
virtual void | eagerJoin (QxSqlRelationParams ¶ms) const =0 |
virtual void | lazyWhere (QxSqlRelationParams ¶ms) const =0 |
virtual void | eagerWhere (QxSqlRelationParams ¶ms) const =0 |
virtual void | lazyWhereSoftDelete (QxSqlRelationParams ¶ms) const =0 |
virtual void | eagerWhereSoftDelete (QxSqlRelationParams ¶ms) const =0 |
virtual void | lazyFetch_ResolveInput (QxSqlRelationParams ¶ms) const =0 |
virtual void | eagerFetch_ResolveInput (QxSqlRelationParams ¶ms) const =0 |
virtual void | lazyFetch_ResolveOutput (QxSqlRelationParams ¶ms) const =0 |
virtual void * | eagerFetch_ResolveOutput (QxSqlRelationParams ¶ms) const =0 |
virtual void | lazyInsert (QxSqlRelationParams ¶ms) const =0 |
virtual void | lazyInsert_Values (QxSqlRelationParams ¶ms) const =0 |
virtual void | lazyUpdate (QxSqlRelationParams ¶ms) const =0 |
virtual void | lazyInsert_ResolveInput (QxSqlRelationParams ¶ms) const =0 |
virtual void | lazyUpdate_ResolveInput (QxSqlRelationParams ¶ms) const =0 |
virtual QSqlError | onBeforeSave (QxSqlRelationParams ¶ms) const =0 |
virtual QSqlError | onAfterSave (QxSqlRelationParams ¶ms) const =0 |
bool | verifyOffset (QxSqlRelationParams ¶ms, bool bId) const BOOST_USED |
Static Public Member Functions | |
static void | setTraceRelationInit (bool bTrace) |
Protected Member Functions | |
QVariant | getIdFromQuery_ManyToMany (bool bEager, QxSqlRelationParams ¶ms) const |
QVariant | getIdFromQuery_ManyToOne (bool bEager, QxSqlRelationParams ¶ms) const |
QVariant | getIdFromQuery_OneToMany (bool bEager, QxSqlRelationParams ¶ms) const |
QVariant | getIdFromQuery_OneToOne (bool bEager, QxSqlRelationParams ¶ms) const |
void | updateOffset_ManyToMany (bool bEager, QxSqlRelationParams ¶ms) const |
void | updateOffset_ManyToOne (bool bEager, QxSqlRelationParams ¶ms) const |
void | updateOffset_OneToMany (bool bEager, QxSqlRelationParams ¶ms) const |
void | updateOffset_OneToOne (bool bEager, QxSqlRelationParams ¶ms) const |
void | eagerSelect_ManyToMany (QxSqlRelationParams ¶ms) const |
void | eagerSelect_ManyToOne (QxSqlRelationParams ¶ms) const |
void | eagerSelect_OneToMany (QxSqlRelationParams ¶ms) const |
void | eagerSelect_OneToOne (QxSqlRelationParams ¶ms) const |
void | eagerJoin_ManyToMany (QxSqlRelationParams ¶ms) const |
void | eagerJoin_ManyToOne (QxSqlRelationParams ¶ms) const |
void | eagerJoin_OneToMany (QxSqlRelationParams ¶ms) const |
void | eagerJoin_OneToOne (QxSqlRelationParams ¶ms) const |
void | eagerWhereSoftDelete_ManyToMany (QxSqlRelationParams ¶ms) const |
void | eagerWhereSoftDelete_ManyToOne (QxSqlRelationParams ¶ms) const |
void | eagerWhereSoftDelete_OneToMany (QxSqlRelationParams ¶ms) const |
void | eagerWhereSoftDelete_OneToOne (QxSqlRelationParams ¶ms) const |
void | lazySelect_ManyToOne (QxSqlRelationParams ¶ms) const |
void | lazyInsert_ManyToOne (QxSqlRelationParams ¶ms) const |
void | lazyInsert_Values_ManyToOne (QxSqlRelationParams ¶ms) const |
void | lazyUpdate_ManyToOne (QxSqlRelationParams ¶ms) const |
void | createTable_ManyToOne (QxSqlRelationParams ¶ms) const |
QSqlError | deleteFromExtraTable_ManyToMany (QxSqlRelationParams ¶ms) const |
QString | createExtraTable_ManyToMany () const |
bool | addLazyRelation (QxSqlRelationParams ¶ms, IxSqlRelation *pRelation) const |
Protected Attributes | |
IxClass * | m_pClass |
'IxClass' associated wth sql relation | |
IxClass * | m_pClassOwner |
'IxClass' of the owner | |
IxDataMember * | m_pDataMember |
'IxDataMember' associated wth sql relation | |
IxDataMemberX * | m_pDataMemberX |
Collection of 'IxDataMember' : parent of 'm_pDataMember'. | |
IxDataMember * | m_pDataMemberId |
'IxDataMember' id of 'm_pDataMemberX' | |
IxDataMember * | m_pDataMemberIdOwner |
'IxDataMember' id of the owner | |
long | m_lOffsetRelation |
Generic offset for sql relation. | |
qx::dao::sql_join::join_type | m_eJoinType |
Join type to build sql query. | |
relation_type | m_eRelationType |
Relation type : one-to-one, one-to-many, etc. | |
QxSoftDelete | m_oSoftDelete |
Soft delete (or logical delete) behavior. | |
QString | m_sForeignKey |
SQL query foreign key (1-n) | |
QString | m_sExtraTable |
Extra-table that holds the relationship (n-n) | |
QString | m_sForeignKeyOwner |
SQL query foreign key for owner (n-n) | |
QString | m_sForeignKeyDataType |
SQL query foreign key for data type (n-n) | |
bool | m_bInitInEvent |
Class initialisation in progress. | |
bool | m_bInitDone |
Class initialisation finished. | |
int | m_iIsSameDataOwner |
Check if relationship source entity and target entity are equal. | |
type_lst_data_member_ptr | m_lstDataMemberPtr |
Optimization : handle to collection of 'IxDataMember'. | |
qx_shared_ptr< IxSqlRelationX > | m_lstSqlRelationPtr |
Optimization : handle to collection of 'IxSqlRelation'. | |
Static Protected Attributes | |
static bool | m_bTraceRelationInit |
Can be useful to debug an issue with relationship initialization. | |
Private Member Functions | |
IxDataMember * | isValid_DataMember (long lIndex) const |
IxDataMember * | isValid_SqlRelation (long lIndex) const |
qx::IxSqlRelation : common interface for all relationships defined between 2 classes (or between 2 tables in database)
Definition at line 73 of file IxSqlRelation.h.
typedef QxCollection<QString, IxDataMember *> qx::IxSqlRelation::type_lst_data_member |
Definition at line 80 of file IxSqlRelation.h.
typedef qx_shared_ptr<type_lst_data_member> qx::IxSqlRelation::type_lst_data_member_ptr |
Definition at line 81 of file IxSqlRelation.h.
Definition at line 78 of file IxSqlRelation.h.
qx::IxSqlRelation::IxSqlRelation | ( | IxDataMember * | p | ) | [inline] |
Definition at line 110 of file IxSqlRelation.h.
virtual qx::IxSqlRelation::~IxSqlRelation | ( | ) | [pure virtual] |
bool qx::IxSqlRelation::addLazyRelation | ( | QxSqlRelationParams & | params, |
IxSqlRelation * | pRelation | ||
) | const [protected] |
virtual QString qx::IxSqlRelation::createExtraTable | ( | ) | const [pure virtual] |
QString qx::IxSqlRelation::createExtraTable_ManyToMany | ( | ) | const [protected] |
virtual void qx::IxSqlRelation::createTable | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
void qx::IxSqlRelation::createTable_ManyToOne | ( | QxSqlRelationParams & | params | ) | const [protected] |
QSqlError qx::IxSqlRelation::deleteFromExtraTable_ManyToMany | ( | QxSqlRelationParams & | params | ) | const [protected] |
virtual void qx::IxSqlRelation::eagerFetch_ResolveInput | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
virtual void* qx::IxSqlRelation::eagerFetch_ResolveOutput | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
virtual void qx::IxSqlRelation::eagerFrom | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
virtual void qx::IxSqlRelation::eagerJoin | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
void qx::IxSqlRelation::eagerJoin_ManyToMany | ( | QxSqlRelationParams & | params | ) | const [protected] |
void qx::IxSqlRelation::eagerJoin_ManyToOne | ( | QxSqlRelationParams & | params | ) | const [protected] |
void qx::IxSqlRelation::eagerJoin_OneToMany | ( | QxSqlRelationParams & | params | ) | const [protected] |
void qx::IxSqlRelation::eagerJoin_OneToOne | ( | QxSqlRelationParams & | params | ) | const [protected] |
virtual void qx::IxSqlRelation::eagerSelect | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
void qx::IxSqlRelation::eagerSelect_ManyToMany | ( | QxSqlRelationParams & | params | ) | const [protected] |
void qx::IxSqlRelation::eagerSelect_ManyToOne | ( | QxSqlRelationParams & | params | ) | const [protected] |
void qx::IxSqlRelation::eagerSelect_OneToMany | ( | QxSqlRelationParams & | params | ) | const [protected] |
void qx::IxSqlRelation::eagerSelect_OneToOne | ( | QxSqlRelationParams & | params | ) | const [protected] |
virtual void qx::IxSqlRelation::eagerWhere | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
virtual void qx::IxSqlRelation::eagerWhereSoftDelete | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
void qx::IxSqlRelation::eagerWhereSoftDelete_ManyToMany | ( | QxSqlRelationParams & | params | ) | const [protected] |
void qx::IxSqlRelation::eagerWhereSoftDelete_ManyToOne | ( | QxSqlRelationParams & | params | ) | const [protected] |
void qx::IxSqlRelation::eagerWhereSoftDelete_OneToMany | ( | QxSqlRelationParams & | params | ) | const [protected] |
void qx::IxSqlRelation::eagerWhereSoftDelete_OneToOne | ( | QxSqlRelationParams & | params | ) | const [protected] |
virtual bool qx::IxSqlRelation::getCartesianProduct | ( | ) | const [pure virtual] |
IxClass* qx::IxSqlRelation::getClass | ( | ) | const [inline] |
Definition at line 119 of file IxSqlRelation.h.
IxClass* qx::IxSqlRelation::getClassOwner | ( | ) | const [inline] |
Definition at line 120 of file IxSqlRelation.h.
IxDataMember* qx::IxSqlRelation::getDataByKey | ( | const QString & | sKey | ) | const |
long qx::IxSqlRelation::getDataCount | ( | ) | const |
IxDataMember* qx::IxSqlRelation::getDataId | ( | ) | const [inline] |
Definition at line 123 of file IxSqlRelation.h.
IxDataMember* qx::IxSqlRelation::getDataIdOwner | ( | ) | const [inline] |
Definition at line 124 of file IxSqlRelation.h.
IxDataMember* qx::IxSqlRelation::getDataMember | ( | ) | const [inline] |
Definition at line 121 of file IxSqlRelation.h.
IxDataMemberX* qx::IxSqlRelation::getDataMemberX | ( | ) | const [inline] |
Definition at line 122 of file IxSqlRelation.h.
virtual QString qx::IxSqlRelation::getDescription | ( | ) | const [pure virtual] |
virtual QString qx::IxSqlRelation::getExtraTable | ( | ) | const [pure virtual] |
virtual QVariant qx::IxSqlRelation::getIdFromQuery | ( | bool | bEager, |
QxSqlRelationParams & | params | ||
) | const [pure virtual] |
QVariant qx::IxSqlRelation::getIdFromQuery_ManyToMany | ( | bool | bEager, |
QxSqlRelationParams & | params | ||
) | const [protected] |
QVariant qx::IxSqlRelation::getIdFromQuery_ManyToOne | ( | bool | bEager, |
QxSqlRelationParams & | params | ||
) | const [protected] |
QVariant qx::IxSqlRelation::getIdFromQuery_OneToMany | ( | bool | bEager, |
QxSqlRelationParams & | params | ||
) | const [protected] |
QVariant qx::IxSqlRelation::getIdFromQuery_OneToOne | ( | bool | bEager, |
QxSqlRelationParams & | params | ||
) | const [protected] |
QString qx::IxSqlRelation::getKey | ( | ) | const |
QxCollection<QString, IxDataMember *>* qx::IxSqlRelation::getLstDataMember | ( | ) | const [inline] |
Definition at line 113 of file IxSqlRelation.h.
IxSqlRelationX* qx::IxSqlRelation::getLstRelation | ( | ) | const [inline] |
Definition at line 114 of file IxSqlRelation.h.
long qx::IxSqlRelation::getRelationCount | ( | ) | const |
relation_type qx::IxSqlRelation::getRelationType | ( | ) | const [inline] |
Definition at line 118 of file IxSqlRelation.h.
QString qx::IxSqlRelation::getSqlJoin | ( | qx::dao::sql_join::join_type | e = qx::dao::sql_join::no_join | ) | const |
qx::dao::sql_join::join_type qx::IxSqlRelation::getSqlJoinType | ( | ) | const [inline] |
Definition at line 117 of file IxSqlRelation.h.
virtual void qx::IxSqlRelation::init | ( | ) | [virtual] |
Reimplemented in qx::QxSqlRelation< DataType, Owner >.
IxDataMember* qx::IxSqlRelation::isValid_DataMember | ( | long | lIndex | ) | const [private] |
IxDataMember* qx::IxSqlRelation::isValid_SqlRelation | ( | long | lIndex | ) | const [private] |
virtual void qx::IxSqlRelation::lazyFetch_ResolveInput | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
virtual void qx::IxSqlRelation::lazyFetch_ResolveOutput | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
virtual void qx::IxSqlRelation::lazyFrom | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
virtual void qx::IxSqlRelation::lazyInsert | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
void qx::IxSqlRelation::lazyInsert_ManyToOne | ( | QxSqlRelationParams & | params | ) | const [protected] |
virtual void qx::IxSqlRelation::lazyInsert_ResolveInput | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
virtual void qx::IxSqlRelation::lazyInsert_Values | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
void qx::IxSqlRelation::lazyInsert_Values_ManyToOne | ( | QxSqlRelationParams & | params | ) | const [protected] |
virtual void qx::IxSqlRelation::lazyJoin | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
virtual void qx::IxSqlRelation::lazySelect | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
void qx::IxSqlRelation::lazySelect_ManyToOne | ( | QxSqlRelationParams & | params | ) | const [protected] |
virtual void qx::IxSqlRelation::lazyUpdate | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
void qx::IxSqlRelation::lazyUpdate_ManyToOne | ( | QxSqlRelationParams & | params | ) | const [protected] |
virtual void qx::IxSqlRelation::lazyUpdate_ResolveInput | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
virtual void qx::IxSqlRelation::lazyWhere | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
virtual void qx::IxSqlRelation::lazyWhereSoftDelete | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
IxDataMember* qx::IxSqlRelation::nextData | ( | long & | lIndex | ) | const |
IxSqlRelation* qx::IxSqlRelation::nextRelation | ( | long & | lIndex | ) | const |
virtual QSqlError qx::IxSqlRelation::onAfterSave | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
virtual QSqlError qx::IxSqlRelation::onBeforeSave | ( | QxSqlRelationParams & | params | ) | const [pure virtual] |
void qx::IxSqlRelation::setSqlJoinType | ( | qx::dao::sql_join::join_type | e | ) | [inline] |
Definition at line 116 of file IxSqlRelation.h.
static void qx::IxSqlRelation::setTraceRelationInit | ( | bool | bTrace | ) | [static] |
QString qx::IxSqlRelation::table | ( | ) | const |
QString qx::IxSqlRelation::tableAlias | ( | QxSqlRelationParams & | params | ) | const |
QString qx::IxSqlRelation::tableAliasOwner | ( | QxSqlRelationParams & | params | ) | const |
bool qx::IxSqlRelation::traceSqlQuery | ( | ) | const |
virtual void qx::IxSqlRelation::updateOffset | ( | bool | bEager, |
QxSqlRelationParams & | params | ||
) | const [pure virtual] |
void qx::IxSqlRelation::updateOffset_ManyToMany | ( | bool | bEager, |
QxSqlRelationParams & | params | ||
) | const [protected] |
void qx::IxSqlRelation::updateOffset_ManyToOne | ( | bool | bEager, |
QxSqlRelationParams & | params | ||
) | const [protected] |
void qx::IxSqlRelation::updateOffset_OneToMany | ( | bool | bEager, |
QxSqlRelationParams & | params | ||
) | const [protected] |
void qx::IxSqlRelation::updateOffset_OneToOne | ( | bool | bEager, |
QxSqlRelationParams & | params | ||
) | const [protected] |
bool qx::IxSqlRelation::verifyOffset | ( | QxSqlRelationParams & | params, |
bool | bId | ||
) | const |
bool qx::IxSqlRelation::m_bInitDone [protected] |
Class initialisation finished.
Definition at line 100 of file IxSqlRelation.h.
bool qx::IxSqlRelation::m_bInitInEvent [protected] |
Class initialisation in progress.
Definition at line 99 of file IxSqlRelation.h.
bool qx::IxSqlRelation::m_bTraceRelationInit [static, protected] |
Can be useful to debug an issue with relationship initialization.
Definition at line 106 of file IxSqlRelation.h.
Join type to build sql query.
Definition at line 92 of file IxSqlRelation.h.
relation_type qx::IxSqlRelation::m_eRelationType [protected] |
Relation type : one-to-one, one-to-many, etc.
Definition at line 93 of file IxSqlRelation.h.
int qx::IxSqlRelation::m_iIsSameDataOwner [protected] |
Check if relationship source entity and target entity are equal.
Definition at line 101 of file IxSqlRelation.h.
long qx::IxSqlRelation::m_lOffsetRelation [protected] |
Generic offset for sql relation.
Definition at line 91 of file IxSqlRelation.h.
Optimization : handle to collection of 'IxDataMember'.
Definition at line 103 of file IxSqlRelation.h.
qx_shared_ptr<IxSqlRelationX> qx::IxSqlRelation::m_lstSqlRelationPtr [protected] |
Optimization : handle to collection of 'IxSqlRelation'.
Definition at line 104 of file IxSqlRelation.h.
QxSoftDelete qx::IxSqlRelation::m_oSoftDelete [protected] |
Soft delete (or logical delete) behavior.
Definition at line 94 of file IxSqlRelation.h.
IxClass* qx::IxSqlRelation::m_pClass [protected] |
'IxClass' associated wth sql relation
Definition at line 85 of file IxSqlRelation.h.
IxClass* qx::IxSqlRelation::m_pClassOwner [protected] |
'IxClass' of the owner
Definition at line 86 of file IxSqlRelation.h.
IxDataMember* qx::IxSqlRelation::m_pDataMember [protected] |
'IxDataMember' associated wth sql relation
Definition at line 87 of file IxSqlRelation.h.
IxDataMember* qx::IxSqlRelation::m_pDataMemberId [protected] |
'IxDataMember' id of 'm_pDataMemberX'
Definition at line 89 of file IxSqlRelation.h.
IxDataMember* qx::IxSqlRelation::m_pDataMemberIdOwner [protected] |
'IxDataMember' id of the owner
Definition at line 90 of file IxSqlRelation.h.
IxDataMemberX* qx::IxSqlRelation::m_pDataMemberX [protected] |
Collection of 'IxDataMember' : parent of 'm_pDataMember'.
Definition at line 88 of file IxSqlRelation.h.
QString qx::IxSqlRelation::m_sExtraTable [protected] |
Extra-table that holds the relationship (n-n)
Definition at line 96 of file IxSqlRelation.h.
QString qx::IxSqlRelation::m_sForeignKey [protected] |
SQL query foreign key (1-n)
Definition at line 95 of file IxSqlRelation.h.
QString qx::IxSqlRelation::m_sForeignKeyDataType [protected] |
SQL query foreign key for data type (n-n)
Definition at line 98 of file IxSqlRelation.h.
QString qx::IxSqlRelation::m_sForeignKeyOwner [protected] |
SQL query foreign key for owner (n-n)
Definition at line 97 of file IxSqlRelation.h.