23 #ifndef _IGNITE_CACHE_QUERY_QUERY_SQL_FIELDS 24 #define _IGNITE_CACHE_QUERY_QUERY_SQL_FIELDS 30 #include <ignite/impl/cache/query/query_argument.h> 55 distributedJoins(false),
56 enforceJoinOrder(false),
73 distributedJoins(false),
74 enforceJoinOrder(false),
88 pageSize(other.pageSize),
90 distributedJoins(other.distributedJoins),
91 enforceJoinOrder(other.enforceJoinOrder),
94 args.reserve(other.args.size());
96 typedef std::vector<impl::cache::query::QueryArgumentBase*>::const_iterator Iter;
98 for (Iter i = other.args.begin(); i != other.args.end(); ++i)
99 args.push_back((*i)->Copy());
124 typedef std::vector<impl::cache::query::QueryArgumentBase*>::const_iterator Iter;
126 for (Iter it = args.begin(); it != args.end(); ++it)
141 swap(sql, other.sql);
142 swap(sql, other.schema);
143 swap(pageSize, other.pageSize);
144 swap(loc, other.loc);
145 swap(distributedJoins, other.distributedJoins);
146 swap(enforceJoinOrder, other.enforceJoinOrder);
147 swap(args, other.args);
188 this->pageSize = pageSize;
218 return enforceJoinOrder;
235 enforceJoinOrder = enforce;
245 return distributedJoins;
258 distributedJoins = enabled;
273 args.push_back(
new impl::cache::query::QueryArgument<T>(arg));
293 this->schema = schema;
320 writer.
WriteInt32(static_cast<int32_t>(args.size()));
322 std::vector<impl::cache::query::QueryArgumentBase*>::const_iterator it;
324 for (it = args.begin(); it != args.end(); ++it)
325 (*it)->Write(writer);
353 bool distributedJoins;
356 bool enforceJoinOrder;
359 std::vector<impl::cache::query::QueryArgumentBase*> args;
365 #endif //_IGNITE_CACHE_QUERY_QUERY_SQL_FIELDS void SetPageSize(int32_t pageSize)
Set page size.
Definition: query_sql_fields.h:186
bool IsDistributedJoins() const
Check if distributed joins are enabled for this query.
Definition: query_sql_fields.h:243
void WriteNull()
Write NULL value.
Definition: binary_raw_writer.cpp:172
void Swap(SqlFieldsQuery &other)
Efficiently swaps contents with another SqlQuery instance.
Definition: query_sql_fields.h:135
const std::string & GetSchema() const
Get schema name for the query.
Definition: query_sql_fields.h:304
Declares ignite::binary::BinaryRawWriter class.
void WriteInt32(int32_t val)
Write 32-byte signed integer.
Definition: binary_raw_writer.cpp:72
void AddArgument(const T &arg)
Add argument.
Definition: query_sql_fields.h:271
int32_t GetPageSize() const
Get page size.
Definition: query_sql_fields.h:176
void SetEnforceJoinOrder(bool enforce)
Sets flag to enforce join order of tables in the query.
Definition: query_sql_fields.h:233
SqlFieldsQuery(const std::string &sql, bool loc)
Constructor.
Definition: query_sql_fields.h:68
void SetSql(const std::string &sql)
Set SQL string.
Definition: query_sql_fields.h:166
void SetLocal(bool loc)
Set local flag.
Definition: query_sql_fields.h:206
Sql fields query.
Definition: query_sql_fields.h:42
void Write(binary::BinaryRawWriter &writer) const
Write query info to the stream.
Definition: query_sql_fields.h:314
void WriteString(const char *val)
Write string.
Definition: binary_raw_writer.cpp:152
bool IsEnforceJoinOrder() const
Checks if join order of tables if enforced.
Definition: query_sql_fields.h:216
void ClearArguments()
Remove all added arguments.
Definition: query_sql_fields.h:279
bool IsLocal() const
Get local flag.
Definition: query_sql_fields.h:196
Binary raw writer.
Definition: binary_raw_writer.h:55
void WriteBool(bool val)
Write bool.
Definition: binary_raw_writer.cpp:42
SqlFieldsQuery(const std::string &sql)
Constructor.
Definition: query_sql_fields.h:50
void SetSchema(const std::string &schema)
Set schema name for the query.
Definition: query_sql_fields.h:291
~SqlFieldsQuery()
Destructor.
Definition: query_sql_fields.h:122
const std::string & GetSql() const
Get SQL string.
Definition: query_sql_fields.h:156
Apache Ignite API.
Definition: cache.h:48
SqlFieldsQuery(const SqlFieldsQuery &other)
Copy constructor.
Definition: query_sql_fields.h:85
void SetDistributedJoins(bool enabled)
Specify if distributed joins are enabled for this query.
Definition: query_sql_fields.h:256
SqlFieldsQuery & operator=(const SqlFieldsQuery &other)
Assignment operator.
Definition: query_sql_fields.h:107