32#ifndef _QX_SQL_RELATION_PARAMS_H_
33#define _QX_SQL_RELATION_PARAMS_H_
46#include <QtSql/qsqldatabase.h>
47#include <QtSql/qsqlquery.h>
QxOrm thread-safe container (keep insertion order + quick access by index + quick access by key)
Define how to join 2 tables into SQL query (LEFT OUTER JOIN, INNER JOIN, etc...)
To improve performance, if you know that you are just inserting or updating items in database.
qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database
qx::IxSqlRelation : common interface for all relationships defined between 2 classes (or between 2 ta...
qx::QxCollection<Key, Value> : QxOrm thread-safe container (keep insertion order + quick access by in...
qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query
void setOwner(void *pOwner)
const QSqlQuery & query() const
QString m_sCustomAliasOwner
Custom SQL table alias owner instead of generating a new one automatically.
void setCustomAliasOwner(const QString &s)
QString getTableAlias() const
void setOffset(long lOffset)
qx::dao::sql_join::join_type joinType() const
const IxSqlQueryBuilder & builder() const
IxSqlQueryBuilder & builder()
void setRelationX(type_lst_relation_linked *p)
void setDatabase(QSqlDatabase *database)
QHash< QString, type_relation_linked_ptr > type_lst_relation_linked
void setIndexOwner(long lIndex)
virtual ~QxSqlRelationParams()
type_lst_relation_linked * m_pRelationX
Current list of relations used by qx::QxSqlRelationLinked class.
QString * m_sql
Current SQL query.
void setRecursiveMode(bool b)
std::shared_ptr< QxSqlRelationLinked > type_relation_linked_ptr
void setTableAlias(const QString &s)
bool m_bRecursiveMode
Recursive mode to iterate over each level of relationship.
QPair< QSet< QString >, long > * m_pColumns
List of relation columns to fetch (syntax : my_relation { column_1, column_2, etc....
QSet< QString > getColumns() const
bool m_bIsDistinct
SQL query of type SELECT DISTINCT.
QSqlDatabase * m_database
Current SQL database connexion.
IxSqlQueryBuilder * m_builder
Current SQL query builder.
QString getCustomAlias() const
const QSqlDatabase & database() const
void insertRecursiveItem(void *p)
void setSql(QString *sql)
QString m_sCustomAlias
Custom SQL table alias instead of generating a new one automatically.
QSqlDatabase & database()
QSqlQuery * m_query
Current SQL query connected to database.
bool checkColumns(const QString &s) const
void setColumns(QPair< QSet< QString >, long > *p)
qx::QxCollection< QString, QVariantList > * m_pLstExecBatch
List of data to send to database when QSqlQuery::execBatch() method is used.
void setCustomAlias(const QString &s)
void setBuilder(IxSqlQueryBuilder *builder)
qx::dao::save_mode::e_save_mode saveMode() const
QString m_sTableAlias
Current SQL table alias : useful for relationships defined in base class.
qx::dao::sql_join::join_type m_eJoinType
Current join type to build SQL query : LEFT OUTER JOIN, INNER JOIN, etc...
void setQuery(QSqlQuery *query)
const QString & sql() const
QString getCustomAliasOwner() const
long getColumnsOffset() const
void setIndex(long lIndex)
QSet< void * > m_lstRecursiveItems
Used by recursive process to avoid infinite loop.
void setJoinType(qx::dao::sql_join::join_type e)
void setLstExecBatch(qx::QxCollection< QString, QVariantList > *p)
QxSqlRelationParams(long lIndex, long lOffset, QString *sql, IxSqlQueryBuilder *builder, QSqlQuery *query, void *pOwner, const QVariant &vId=QVariant(), qx::QxCollection< QString, QVariantList > *pLstExecBatch=NULL)
void * m_pOwner
Owner to current object to resolve input/output.
bool existRecursiveItem(void *p) const
void setColumnsOffset(long l)
qx::dao::save_mode::e_save_mode m_eSaveMode
Used to improve performance, if you know that you are just inserting or updating items in database.
qx::QxCollection< QString, QVariantList > * getLstExecBatch() const
type_lst_relation_linked * relationX() const
bool recursiveMode() const
long m_lIndex
Current SQL relation index.
void setSaveMode(qx::dao::save_mode::e_save_mode e)
long getColumnsCount() const
QVariant m_vId
Current id.
long m_lOffset
Current SQL query offset.
long m_lIndexOwner
Current SQL relation owner index.
void setId(const QVariant &vId)
Root namespace for all QxOrm library features.