initial matador ng commit
This commit is contained in:
@@ -1,19 +1,22 @@
|
||||
#ifndef QUERY_ACCESS_HPP
|
||||
#define QUERY_ACCESS_HPP
|
||||
#ifndef OOS_ACCESS_HPP
|
||||
#define OOS_ACCESS_HPP
|
||||
|
||||
#include <string>
|
||||
#include <optional>
|
||||
|
||||
namespace matador::utils {
|
||||
namespace matador {
|
||||
|
||||
enum class cascade_type;
|
||||
|
||||
template < class Type, template < class ... > class ContainerType >
|
||||
class container;
|
||||
|
||||
namespace utils {
|
||||
class field_attributes;
|
||||
class foreign_attributes;
|
||||
}
|
||||
|
||||
namespace access {
|
||||
|
||||
template<class Operator, class Type>
|
||||
void process(Operator &op, Type &object) {
|
||||
object.process(op);
|
||||
@@ -40,12 +43,12 @@ void revision(Operator &op, const char *id, unsigned long long &value) {
|
||||
}
|
||||
|
||||
template<class Operator, class Type>
|
||||
void attribute(Operator &op, const char *id, Type &value, const field_attributes &attr) {
|
||||
void attribute(Operator &op, const char *id, Type &value, const utils::field_attributes &attr) {
|
||||
op.on_attribute(id, value, attr);
|
||||
}
|
||||
|
||||
template<class Operator, class Type>
|
||||
void attribute(Operator &op, const char *id, std::optional<Type> &value, const field_attributes &attr) {
|
||||
void attribute(Operator &op, const char *id, std::optional<Type> &value, const utils::field_attributes &attr) {
|
||||
op.on_attribute(id, value, attr);
|
||||
}
|
||||
|
||||
@@ -55,32 +58,67 @@ void attribute(Operator &op, const char *id, Type &value) {
|
||||
}
|
||||
|
||||
template<class Operator, class Type>
|
||||
void has_one(Operator &op, const char *id, Type &value, const foreign_attributes &attr) {
|
||||
void has_one(Operator &op, const char *id, Type &value, const utils::foreign_attributes &attr) {
|
||||
op.on_has_one(id, value, attr);
|
||||
}
|
||||
|
||||
template<class Operator, class Type>
|
||||
void belongs_to(Operator &op, const char *id, Type &value, const foreign_attributes &attr) {
|
||||
void has_one(Operator &op, const char *id, Type &value) {
|
||||
op.on_has_one(id, value);
|
||||
}
|
||||
|
||||
template<class Operator, class Type>
|
||||
void belongs_to(Operator &op, const char *id, Type &value, const utils::foreign_attributes &attr) {
|
||||
op.on_belongs_to(id, value, attr);
|
||||
}
|
||||
|
||||
template<class Operator, class Type, template<class ...> class ContainerType>
|
||||
void has_many(Operator &op, ContainerType<Type> &container, const char *join_column, const foreign_attributes &attr) {
|
||||
op.on_has_many(container, join_column, attr);
|
||||
template<class Operator, class Type>
|
||||
void belongs_to(Operator &op, const char *id, Type &value) {
|
||||
op.on_belongs_to(id, value);
|
||||
}
|
||||
|
||||
template<class Operator, class Type, template<class ...> class ContainerType>
|
||||
void has_many_to_many(Operator &op, const char *id, ContainerType<Type> &container, const char *join_column, const char *inverse_join_column, const foreign_attributes &attr) {
|
||||
op.on_has_many_to_many(id, container, join_column, inverse_join_column, attr);
|
||||
void has_many(Operator &op, const char *id, container<Type, ContainerType> &c, const char *join_column, const utils::foreign_attributes &attr) {
|
||||
op.on_has_many(id, c, join_column, attr);
|
||||
}
|
||||
|
||||
template<class Operator, class Type, template<class ...> class ContainerType>
|
||||
void has_many_to_many(Operator &op, const char *id, ContainerType<Type> &container, const foreign_attributes &attr) {
|
||||
op.on_has_many_to_many(id, container, attr);
|
||||
void has_many(Operator &op, const char *id, container<Type, ContainerType> &c, const char *join_column) {
|
||||
op.on_has_many(id, c, join_column);
|
||||
}
|
||||
|
||||
template<class Operator, class Type, template<class ...> class ContainerType>
|
||||
void has_many(Operator &op, const char *id, container<Type, ContainerType> &c, const utils::foreign_attributes &attr) {
|
||||
op.on_has_many(id, c, attr);
|
||||
}
|
||||
|
||||
template<class Operator, class Type, template<class ...> class ContainerType>
|
||||
void has_many(Operator &op, const char *id, container<Type, ContainerType> &c) {
|
||||
op.on_has_many(id, c);
|
||||
}
|
||||
|
||||
template<class Operator, class ContainerType>
|
||||
void has_many_to_many(Operator &op, const char *id, ContainerType &c, const char *join_column, const char *inverse_join_column, const utils::foreign_attributes &attr) {
|
||||
op.on_has_many_to_many(id, c, join_column, inverse_join_column, attr);
|
||||
}
|
||||
|
||||
template<class Operator, class ContainerType>
|
||||
void has_many_to_many(Operator &op, const char *id, ContainerType &c, const char *join_column, const char *inverse_join_column) {
|
||||
op.on_has_many_to_many(id, c, join_column, inverse_join_column);
|
||||
}
|
||||
|
||||
template<class Operator, class ContainerType>
|
||||
void has_many_to_many(Operator &op, const char *id, ContainerType &c, const utils::foreign_attributes &attr) {
|
||||
op.on_has_many_to_many(id, c, attr);
|
||||
}
|
||||
|
||||
template<class Operator, class ContainerType>
|
||||
void has_many_to_many(Operator &op, const char *id, ContainerType &c) {
|
||||
op.on_has_many_to_many(id, c);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif //QUERY_ACCESS_HPP
|
||||
#endif //OOS_ACCESS_HPP
|
||||
|
||||
Reference in New Issue
Block a user