32#ifdef _QX_ENABLE_MONGODB
33#ifndef _QX_DAO_MONGODB_HELPER_H_
34#define _QX_DAO_MONGODB_HELPER_H_
47#include <QtSql/qsqlerror.h>
72struct QxMongoDB_Fetcher;
78class QX_DLL_EXPORT QxMongoDB_Helper :
public QxSingleton<QxMongoDB_Helper>
81 friend class QxSingleton<QxMongoDB_Helper>;
85 enum opts { opts_collection_insert_one, opts_collection_insert_many, opts_collection_update_one, opts_collection_update_many,
86 opts_collection_delete_one, opts_collection_delete_many, opts_collection_find, opts_collection_command, opts_collection_count,
87 opts_collection_create_bulk_operation, opts_bulk_operation_update_one, opts_bulk_operation_remove_one, opts_collection_aggregate };
91 struct QxMongoDB_HelperImpl;
92 std::unique_ptr<QxMongoDB_HelperImpl> m_pImpl;
95 virtual ~QxMongoDB_Helper();
111 static QSqlError autoCreateIndexes(
bool log =
true);
112 static bool setOptions(opts e,
const QString & optsAsJson);
113 static void setLogDatabaseReply(
bool b);
114 static void setLogDatabaseInfo(
bool b);
115 static void clearPoolConnection();
127 virtual ~QxMongoDB_Fetcher();
129 virtual void fetch(
const QString & json) = 0;
#define QX_DLL_EXPORT_QX_SINGLETON_HPP(x)
Concrete class to define a thread-safe singleton of QxOrm library.
qx::IxClass : common interface for all classes registered into QxOrm context
qx::QxSqlQuery : define a user SQL query added to default SQL query builded by QxOrm library,...
qx::dao::detail::IxDao_Helper : helper class to communicate with database
long count()
Return the number of objects in the cache.
Root namespace for all QxOrm library features.