32#ifndef _IX_SQL_QUERY_BUILDER_H_
33#define _IX_SQL_QUERY_BUILDER_H_
73 struct IxSqlQueryBuilderImpl;
74 std::unique_ptr<IxSqlQueryBuilderImpl>
m_pImpl;
102 bool insertIdX(
long lIndex,
const QVariant & idOwner,
const QVariant & idData,
void * ptr);
103 void *
existIdX(
long lIndex,
const QVariant & idOwner,
const QVariant & idData);
104 void setSqlQuery(
const QString & sql,
const QString & key = QString());
113 static QString
addSqlCondition(
const QString & sql) {
return (sql.contains(
" WHERE ") ?
" AND " :
" WHERE "); }
Helper class to communicate with database.
Common interface for a list of IxDataMember class properties registered into QxOrm context (for examp...
Common interface for all relationships defined between 2 classes (or between 2 tables in database)
Soft delete (or logical delete) behavior to update a row into database (flag it as deleted) instead o...
Hierarchy of relationships to build SQL query.
qx::IxDataMember : common interface for all class properties registered into QxOrm context
qx::IxDataMemberX : common interface for a list of IxDataMember class properties registered into QxOr...
qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database
virtual IxSqlQueryBuilder & buildSql(const QStringList &columns=QStringList(), QxSqlRelationLinked *pRelationX=NULL)=0
bool getCartesianProduct() const
void insertSqlAlias(const QString &key)
virtual ~IxSqlQueryBuilder()=0
QString getHashRelation() const
QxSoftDelete & softDelete()
static void sql_FetchAll(QString &sql, IxSqlQueryBuilder &builder, const QStringList &columns)
bool getAddAutoIncrementIdToUpdateQuery() const
static void sql_Count_WithRelation(qx::QxSqlRelationLinked *pRelationX, QString &sql, IxSqlQueryBuilder &builder)
static QString addSqlCondition(const QString &sql)
IxDataMember * nextData(long &l) const
static void sql_Insert(QString &sql, IxSqlQueryBuilder &builder)
long getDataCount() const
static void sql_Update(QString &sql, IxSqlQueryBuilder &builder)
static void sql_FetchAll_WithRelation(qx::QxSqlRelationLinked *pRelationX, QString &sql, IxSqlQueryBuilder &builder)
const QxSoftDelete & softDelete() const
static void sql_FetchById(QString &sql, IxSqlQueryBuilder &builder, const QStringList &columns)
void setHashRelation(const QString &s)
void addSqlQueryAlias(const QString &sql, const QString &sqlAlias)
static void resolveOutput_FetchAll(void *t, QSqlQuery &query, IxSqlQueryBuilder &builder)
static void resolveOutput_FetchAll(void *t, QSqlQuery &query, IxSqlQueryBuilder &builder, const QStringList &columns)
QxSoftDelete getSoftDelete() const
qx::dao::detail::IxDao_Helper * getDaoHelper() const
IxDataMember * getDataId() const
void setDataMemberX(IxDataMemberX *p)
static void resolveInput_Update(void *t, QSqlQuery &query, IxSqlQueryBuilder &builder, const QStringList &columns)
static void resolveOutput_FetchAll_WithRelation(qx::QxSqlRelationLinked *pRelationX, void *t, QSqlQuery &query, IxSqlQueryBuilder &builder)
IxSqlRelation * nextRelation(long &l) const
std::unique_ptr< IxSqlQueryBuilderImpl > m_pImpl
Private implementation idiom.
long getRelationCount() const
virtual void clone(const IxSqlQueryBuilder &other)
static void sql_FetchById_WithRelation(qx::QxSqlRelationLinked *pRelationX, QString &sql, IxSqlQueryBuilder &builder)
static void sql_DeleteById(QString &sql, IxSqlQueryBuilder &builder, bool bSoftDelete)
void initIdX(long lAllRelationCount)
QString & getCurrentBuildingSql() const
bool findSqlQuery(const QString &key)
void setSoftDelete(const QxSoftDelete &o)
void * existIdX(long lIndex, const QVariant &idOwner, const QVariant &idData)
static void sql_CreateTable(QString &sql, IxSqlQueryBuilder &builder)
static void sql_FetchAll(QString &sql, IxSqlQueryBuilder &builder)
void replaceSqlQueryAlias(QString &sql) const
QString getSqlQuery() const
void setSqlQuery(const QString &sql, const QString &key=QString())
static void sql_FetchById(QString &sql, IxSqlQueryBuilder &builder)
static void sql_Exist(QString &sql, IxSqlQueryBuilder &builder)
static void resolveInput_Insert(void *t, QSqlQuery &query, IxSqlQueryBuilder &builder)
void setCartesianProduct(bool b)
bool insertIdX(long lIndex, const QVariant &idOwner, const QVariant &idData, void *ptr)
static void sql_Update(QString &sql, IxSqlQueryBuilder &builder, const QStringList &columns)
bool verifyColumns(const QStringList &columns) const QX_USED
QxCollection< QString, IxDataMember * > * getLstDataMember() const
static void resolveInput_DeleteById(void *t, QSqlQuery &query, IxSqlQueryBuilder &builder)
IxSqlRelationX * getLstRelation() const
static void resolveInput_Update(void *t, QSqlQuery &query, IxSqlQueryBuilder &builder)
bool findSqlAlias(const QString &key)
IxDataMemberX * getDataMemberX() const
void setDaoHelper(qx::dao::detail::IxDao_Helper *p)
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::QxSoftDelete : soft delete (or logical delete) behavior to update a row into database (flag it as...
qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query
qx::dao::detail::IxDao_Helper : helper class to communicate with database
Root namespace for all QxOrm library features.
std::shared_ptr< IxSqlQueryBuilder > IxSqlQueryBuilder_ptr