![]() |
QxOrm
1.4.3
C++ Object Relational Mapping library
|
qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query More...
#include <QxSqlRelationLinked.h>
Public Member Functions | |
QxSqlRelationLinked () | |
QxSqlRelationLinked (bool bRoot) | |
virtual | ~QxSqlRelationLinked () |
qx_bool | buildHierarchy (IxSqlRelationX *pRelationX, const QStringList &sRelationX) |
void | hierarchySelect (QxSqlRelationParams ¶ms) |
void | hierarchyFrom (QxSqlRelationParams ¶ms) |
void | hierarchyJoin (QxSqlRelationParams ¶ms) |
void | hierarchyWhereSoftDelete (QxSqlRelationParams ¶ms) |
void | hierarchyResolveOutput (QxSqlRelationParams ¶ms) |
QSqlError | hierarchyOnBeforeSave (QxSqlRelationParams ¶ms) |
QSqlError | hierarchyOnAfterSave (QxSqlRelationParams ¶ms) |
void | updateOffset (QxSqlRelationParams ¶ms) |
bool | getCartesianProduct () const |
long | getAllRelationCount () const |
long | getRelationCount () const |
bool | existRelation (const QString &sKey) const |
bool | checkRootColumns (const QString &s) const |
long | getRootColumnsCount () const |
long | getRootColumnsOffset () const |
void | setRootColumnsOffset (long l) |
Protected Types | |
typedef qx_shared_ptr < QxSqlRelationLinked > | type_ptr |
typedef boost::tuple < qx::dao::sql_join::join_type, IxSqlRelation *, QPair< QSet < QString >, long > > | type_relation |
typedef qx::QxCollection < QString, type_relation > | type_lst_relation |
typedef QHash< QString, type_ptr > | type_lst_relation_linked |
Protected Member Functions | |
QStringList | removeColumns (const QStringList &columnsToRemove, IxSqlRelation *pRelation) const |
qx_bool | insertRelationToHierarchy (const QStringList &sRelationX, const QString &sKey, qx::dao::sql_join::join_type eJoinType) |
bool | isValidDaoHelper (QxSqlRelationParams ¶ms) const |
Protected Attributes | |
type_lst_relation | m_relationX |
List of relationships for current level. | |
type_lst_relation_linked | m_relationLinkedX |
List of child to build the hierarchy. | |
IxSqlRelationX * | m_allRelationX |
List of all relationships per level. | |
bool | m_bRoot |
Root of the hierarchy. | |
QSet< QString > | m_lstRootColumns |
Root columns to fetch (using syntax { col_1, col_2, etc... } ), if empty then fetch all root columns. | |
long | m_lRootColumnsOffset |
Root columns offset to resolve SQL query output. | |
bool | m_bRootColumnsModeRemove |
Special syntax to remove root columns instead of adding root columns : -{ column1, column2, etc... }. |
qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query
Here is the structure, each real relation has a relation linked associated to build the hierarchy, like this :
(<root>, <relation_linked>) ("blog", blog_relation) ("blog", <relation_linked>) ("author", author_relation) ("author", <relation_linked>) ("list_blog", list_blog_relation) ("list_blog", <relation_linked>) (etc...) ("comment", comment_relation) ("comment", <relation_linked>) ("blog_id", blog_id_relation) ("blog_id", <relation_linked>) (etc...) ("category", category_relation) ("category", <relation_linked>) ("list_blog", list_blog_relation) ("list_blog", <relation_linked>) (etc...)
Definition at line 86 of file QxSqlRelationLinked.h.
typedef qx::QxCollection<QString, type_relation> qx::QxSqlRelationLinked::type_lst_relation [protected] |
Definition at line 93 of file QxSqlRelationLinked.h.
typedef QHash<QString, type_ptr> qx::QxSqlRelationLinked::type_lst_relation_linked [protected] |
Definition at line 94 of file QxSqlRelationLinked.h.
typedef qx_shared_ptr<QxSqlRelationLinked> qx::QxSqlRelationLinked::type_ptr [protected] |
Definition at line 91 of file QxSqlRelationLinked.h.
typedef boost::tuple<qx::dao::sql_join::join_type, IxSqlRelation *, QPair<QSet<QString>, long> > qx::QxSqlRelationLinked::type_relation [protected] |
Definition at line 92 of file QxSqlRelationLinked.h.
qx::QxSqlRelationLinked::QxSqlRelationLinked | ( | ) |
qx::QxSqlRelationLinked::QxSqlRelationLinked | ( | bool | bRoot | ) |
virtual qx::QxSqlRelationLinked::~QxSqlRelationLinked | ( | ) | [virtual] |
qx_bool qx::QxSqlRelationLinked::buildHierarchy | ( | IxSqlRelationX * | pRelationX, |
const QStringList & | sRelationX | ||
) |
bool qx::QxSqlRelationLinked::checkRootColumns | ( | const QString & | s | ) | const [inline] |
Definition at line 126 of file QxSqlRelationLinked.h.
bool qx::QxSqlRelationLinked::existRelation | ( | const QString & | sKey | ) | const |
long qx::QxSqlRelationLinked::getAllRelationCount | ( | ) | const |
bool qx::QxSqlRelationLinked::getCartesianProduct | ( | ) | const |
long qx::QxSqlRelationLinked::getRelationCount | ( | ) | const |
long qx::QxSqlRelationLinked::getRootColumnsCount | ( | ) | const [inline] |
Definition at line 127 of file QxSqlRelationLinked.h.
long qx::QxSqlRelationLinked::getRootColumnsOffset | ( | ) | const [inline] |
Definition at line 128 of file QxSqlRelationLinked.h.
void qx::QxSqlRelationLinked::hierarchyFrom | ( | QxSqlRelationParams & | params | ) |
void qx::QxSqlRelationLinked::hierarchyJoin | ( | QxSqlRelationParams & | params | ) |
QSqlError qx::QxSqlRelationLinked::hierarchyOnAfterSave | ( | QxSqlRelationParams & | params | ) |
QSqlError qx::QxSqlRelationLinked::hierarchyOnBeforeSave | ( | QxSqlRelationParams & | params | ) |
void qx::QxSqlRelationLinked::hierarchyResolveOutput | ( | QxSqlRelationParams & | params | ) |
void qx::QxSqlRelationLinked::hierarchySelect | ( | QxSqlRelationParams & | params | ) |
void qx::QxSqlRelationLinked::hierarchyWhereSoftDelete | ( | QxSqlRelationParams & | params | ) |
qx_bool qx::QxSqlRelationLinked::insertRelationToHierarchy | ( | const QStringList & | sRelationX, |
const QString & | sKey, | ||
qx::dao::sql_join::join_type | eJoinType | ||
) | [protected] |
bool qx::QxSqlRelationLinked::isValidDaoHelper | ( | QxSqlRelationParams & | params | ) | const [protected] |
QStringList qx::QxSqlRelationLinked::removeColumns | ( | const QStringList & | columnsToRemove, |
IxSqlRelation * | pRelation | ||
) | const [protected] |
void qx::QxSqlRelationLinked::setRootColumnsOffset | ( | long | l | ) | [inline] |
Definition at line 129 of file QxSqlRelationLinked.h.
void qx::QxSqlRelationLinked::updateOffset | ( | QxSqlRelationParams & | params | ) |
IxSqlRelationX* qx::QxSqlRelationLinked::m_allRelationX [protected] |
List of all relationships per level.
Definition at line 98 of file QxSqlRelationLinked.h.
bool qx::QxSqlRelationLinked::m_bRoot [protected] |
Root of the hierarchy.
Definition at line 99 of file QxSqlRelationLinked.h.
bool qx::QxSqlRelationLinked::m_bRootColumnsModeRemove [protected] |
Special syntax to remove root columns instead of adding root columns : -{ column1, column2, etc... }.
Definition at line 102 of file QxSqlRelationLinked.h.
long qx::QxSqlRelationLinked::m_lRootColumnsOffset [protected] |
Root columns offset to resolve SQL query output.
Definition at line 101 of file QxSqlRelationLinked.h.
QSet<QString> qx::QxSqlRelationLinked::m_lstRootColumns [protected] |
Root columns to fetch (using syntax { col_1, col_2, etc... } ), if empty then fetch all root columns.
Definition at line 100 of file QxSqlRelationLinked.h.
List of child to build the hierarchy.
Definition at line 97 of file QxSqlRelationLinked.h.
List of relationships for current level.
Definition at line 96 of file QxSqlRelationLinked.h.