changed type of on_revision value parameter to uint64_t
This commit is contained in:
parent
1fd2066946
commit
399fa9a157
|
|
@ -26,15 +26,15 @@ public:
|
|||
}
|
||||
template < class V >
|
||||
static void on_primary_key(const char * /*id*/, V &, const utils::primary_key_attribute& /*attr*/ = utils::default_pk_attributes) {}
|
||||
static void on_revision(const char * /*id*/, unsigned long long &/*rev*/) {}
|
||||
static void on_revision(const char * /*id*/, uint64_t &/*rev*/) {}
|
||||
template<typename Type>
|
||||
static void on_attribute(const char * /*id*/, Type &, const utils::field_attributes &/*attr*/ = utils::null_attributes) {}
|
||||
template<class Pointer>
|
||||
static void on_belongs_to(const char * /*id*/, Pointer &obj, const utils::foreign_attributes &attr) {}
|
||||
static void on_belongs_to(const char * /*id*/, Pointer &/*obj*/, const utils::foreign_attributes &/*attr*/) {}
|
||||
template<class Pointer>
|
||||
static void on_has_one(const char * /*id*/, Pointer &obj, const utils::foreign_attributes &attr) {}
|
||||
static void on_has_one(const char * /*id*/, Pointer &/*obj*/, const utils::foreign_attributes &/*attr*/) {}
|
||||
template<class ContainerType>
|
||||
static void on_has_many(ContainerType &, const char *join_column, const utils::foreign_attributes &attr) {}
|
||||
static void on_has_many(ContainerType &, const char */*join_column*/, const utils::foreign_attributes &/*attr*/) {}
|
||||
template<class ContainerType>
|
||||
void on_has_many_to_many(const char * /*id*/, ContainerType &/*c*/, const char *join_column, const char *inverse_join_column, const utils::foreign_attributes &/*attr*/) {
|
||||
join_columns_.join_column = join_column;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include "matador/orm/error_code.hpp"
|
||||
#include "matador/orm/session_query_builder.hpp"
|
||||
|
||||
#include "matador/query/condition.hpp"
|
||||
#include "matador/query/query.hpp"
|
||||
|
||||
#include "matador/sql/column_generator.hpp"
|
||||
|
|
@ -58,7 +59,7 @@ public:
|
|||
|
||||
template < class V >
|
||||
static void on_primary_key(const char * /*id*/, V &/*pk*/, const utils::primary_key_attribute& /*attr*/ = utils::default_pk_attributes) {}
|
||||
static void on_revision(const char * /*id*/, unsigned long long &/*rev*/) {}
|
||||
static void on_revision(const char * /*id*/, uint64_t &/*rev*/) {}
|
||||
template<typename Type>
|
||||
static void on_attribute(const char * /*id*/, Type &/*obj*/, const utils::field_attributes &/*attr*/ = utils::null_attributes) {}
|
||||
template<class Pointer>
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ public:
|
|||
push(id, x);
|
||||
}
|
||||
|
||||
void on_revision(const char *id, unsigned long long &/*rev*/);
|
||||
void on_revision(const char *id, uint64_t &/*rev*/);
|
||||
|
||||
template<typename Type>
|
||||
void on_attribute(const char *id, Type &x, const utils::field_attributes &/*attr*/ = utils::null_attributes) {
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void on_revision(const char *id, unsigned long long &/*rev*/);
|
||||
void on_revision(const char *id, uint64_t &/*rev*/);
|
||||
|
||||
template<typename Type>
|
||||
void on_attribute(const char *id, Type &, const utils::field_attributes &/*attr*/ = utils::null_attributes)
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public:
|
|||
void on_primary_key(const char *, ValueType &pk, const utils::primary_key_attribute& /*attr*/ = utils::default_pk_attributes) {
|
||||
value_ = pk;
|
||||
}
|
||||
static void on_revision(const char * /*id*/, unsigned long long &/*rev*/) {}
|
||||
static void on_revision(const char * /*id*/, uint64_t &/*rev*/) {}
|
||||
template < class Type >
|
||||
static void on_attribute(const char * /*id*/, Type &/*x*/, const utils::field_attributes &/*attr*/ = utils::null_attributes) {}
|
||||
static void on_attribute(const char * /*id*/, char * /*x*/, const utils::field_attributes &/*attr*/ = utils::null_attributes) {}
|
||||
|
|
|
|||
|
|
@ -15,12 +15,11 @@ class key_value_generator
|
|||
{
|
||||
private:
|
||||
public:
|
||||
explicit key_value_generator(std::vector<internal::key_value_pair> &result) : result_(result) {}
|
||||
explicit key_value_generator(std::vector<internal::key_value_pair> &result);
|
||||
|
||||
public:
|
||||
template < class Type >
|
||||
static std::vector<internal::key_value_pair> generate(const Type &obj)
|
||||
{
|
||||
static std::vector<internal::key_value_pair> generate(const Type &obj) {
|
||||
std::vector<internal::key_value_pair> result;
|
||||
key_value_generator generator(result);
|
||||
access::process(generator, obj);
|
||||
|
|
@ -32,29 +31,26 @@ public:
|
|||
void on_primary_key(const char *id, V &x, const utils::primary_key_attribute& /*attr*/ = utils::default_pk_attributes) {
|
||||
result_.emplace_back(id, x);
|
||||
}
|
||||
void on_revision(const char *id, unsigned long long &/*rev*/);
|
||||
void on_revision(const char *id, uint64_t &/*rev*/);
|
||||
|
||||
template<typename Type>
|
||||
void on_attribute(const char *id, Type &x, const utils::field_attributes &/*attr*/ = utils::null_attributes)
|
||||
{
|
||||
void on_attribute(const char *id, Type &x, const utils::field_attributes &/*attr*/ = utils::null_attributes) {
|
||||
result_.emplace_back(id, x);
|
||||
}
|
||||
|
||||
template<class Type, template < class ... > class Pointer>
|
||||
void on_belongs_to(const char *id, Pointer<Type> &x, const utils::foreign_attributes &/*attr*/)
|
||||
{
|
||||
void on_belongs_to(const char *id, Pointer<Type> &x, const utils::foreign_attributes &/*attr*/) {
|
||||
result_.emplace_back(id, fk_value_extractor_.extract(*x));
|
||||
}
|
||||
template<class Type, template < class ... > class Pointer>
|
||||
void on_has_one(const char *id, Pointer<Type> &x, const utils::foreign_attributes &/*attr*/)
|
||||
{
|
||||
void on_has_one(const char *id, Pointer<Type> &x, const utils::foreign_attributes &/*attr*/) {
|
||||
result_.emplace_back(id, fk_value_extractor_.extract(*x));
|
||||
}
|
||||
template<class ContainerType>
|
||||
void on_has_many(const char *, ContainerType &, const char *, const char *, const utils::foreign_attributes &/*attr*/) {}
|
||||
static void on_has_many(const char *, ContainerType &, const char *, const char *, const utils::foreign_attributes &/*attr*/) {}
|
||||
|
||||
private:
|
||||
detail::fk_value_extractor fk_value_extractor_;
|
||||
detail::fk_value_extractor fk_value_extractor_{};
|
||||
std::vector<internal::key_value_pair> &result_;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public:
|
|||
}
|
||||
push(id);
|
||||
}
|
||||
void on_revision(const char *id, unsigned long long &/*rev*/);
|
||||
void on_revision(const char *id, uint64_t &/*rev*/);
|
||||
|
||||
template<typename Type>
|
||||
void on_attribute(const char *id, Type &, const utils::field_attributes &/*attr*/ = utils::null_attributes) {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public:
|
|||
|
||||
template<typename ValueType>
|
||||
void on_primary_key(const char *id, ValueType &value, const utils::primary_key_attribute& attr = utils::default_pk_attributes);
|
||||
static void on_revision(const char * /*id*/, unsigned long long &/*rev*/) {}
|
||||
static void on_revision(const char * /*id*/, uint64_t &/*rev*/) {}
|
||||
|
||||
template < class Type >
|
||||
static void on_attribute(const char * /*id*/, Type &/*x*/, const utils::field_attributes &/*attr*/ = utils::null_attributes) {}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public:
|
|||
|
||||
template<typename ValueType>
|
||||
void on_primary_key(const char *id, ValueType &value, const utils::primary_key_attribute& attr = utils::default_pk_attributes);
|
||||
void on_revision(const char * /*id*/, unsigned long long &/*rev*/) {
|
||||
void on_revision(const char * /*id*/, uint64_t &/*rev*/) {
|
||||
++column_index_;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public:
|
|||
utils::data_type_traits<ValueType>::read_value(reader_, id, column_index_++, value, attr.size());
|
||||
pk_ = value;
|
||||
}
|
||||
void on_revision(const char * /*id*/, unsigned long long &/*rev*/) { ++column_index_; }
|
||||
void on_revision(const char * /*id*/, uint64_t &/*rev*/) { ++column_index_; }
|
||||
|
||||
template < class Type >
|
||||
void on_attribute(const char * /*id*/, Type &/*x*/, const utils::field_attributes &/*attr*/ = utils::null_attributes) { ++column_index_; }
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "matador/orm/session_insert_builder.hpp"
|
||||
|
||||
namespace matador::orm {
|
||||
void session_insert_builder::on_revision(const char* id, unsigned long long& x) {
|
||||
void session_insert_builder::on_revision(const char* id, uint64_t& x) {
|
||||
push(id, x);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include <iostream>
|
||||
|
||||
namespace matador::orm {
|
||||
void session_query_builder::on_revision(const char *id, unsigned long long &/*rev*/) {
|
||||
void session_query_builder::on_revision(const char *id, uint64_t &/*rev*/) {
|
||||
push(id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,10 @@
|
|||
#include "matador/query/value_extractor.hpp"
|
||||
|
||||
namespace matador::query {
|
||||
key_value_generator::key_value_generator(std::vector<internal::key_value_pair> &result)
|
||||
: result_(result) {}
|
||||
|
||||
void key_value_generator::on_revision(const char *id, unsigned long long int &x) {
|
||||
void key_value_generator::on_revision(const char *id, uint64_t &x) {
|
||||
result_.emplace_back(id, x);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ std::vector<column> column_generator::generate( const object::repository& scm, c
|
|||
return columns;
|
||||
}
|
||||
|
||||
void column_generator::on_revision(const char *id, unsigned long long int &)
|
||||
void column_generator::on_revision(const char *id, uint64_t &)
|
||||
{
|
||||
if (has_many_to_many_) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in New Issue