// This file was generated by ODB, object-relational mapping (ORM)
// compiler for C++.
//
#ifndef USER_ODB_HXX
#define USER_ODB_HXX
#include <odb/version.hxx>
#if (ODB_VERSION != 20200UL)
#error ODB runtime version mismatch
#endif
#include <odb/pre.hxx>
#include "user.hxx"
#include <memory>
#include <cstddef>
#include <odb/core.hxx>
#include <odb/traits.hxx>
#include <odb/callback.hxx>
#include <odb/wrapper-traits.hxx>
#include <odb/pointer-traits.hxx>
#include <odb/container-traits.hxx>
#include <odb/no-op-cache-traits.hxx>
#include <odb/result.hxx>
#include <odb/simple-object-result.hxx>
#include <odb/details/unused.hxx>
#include <odb/details/shared-ptr.hxx>
namespace odb
{
// user
//
template <>
struct class_traits< ::user >
{
static const class_kind kind = class_object;
};
template <>
class access::object_traits< ::user >
{
public:
typedef ::user object_type;
typedef ::user* pointer_type;
typedef odb::pointer_traits<pointer_type> pointer_traits;
static const bool polymorphic = false;
typedef long unsigned int id_type;
static const bool auto_id = true;
static const bool abstract = false;
static id_type
id (const object_type&);
typedef
no_op_pointer_cache_traits<pointer_type>
pointer_cache_traits;
typedef
no_op_reference_cache_traits<object_type>
reference_cache_traits;
static void
callback (database&, object_type&, callback_event);
static void
callback (database&, const object_type&, callback_event);
};
}
#include <odb/details/buffer.hxx>
#include <odb/mysql/version.hxx>
#include <odb/mysql/forward.hxx>
#include <odb/mysql/binding.hxx>
#include <odb/mysql/mysql-types.hxx>
#include <odb/mysql/query.hxx>
namespace odb
{
// user
//
template <typename A>
struct query_columns< ::user, id_mysql, A >
{
// id
//
typedef
mysql::query_column<
mysql::value_traits<
long unsigned int,
mysql::id_ulonglong >::query_type,
mysql::id_ulonglong >
id_type_;
static const id_type_ id;
// nickname
//
typedef
mysql::query_column<
mysql::value_traits<
::std::string,
mysql::id_string >::query_type,
mysql::id_string >
nickname_type_;
static const nickname_type_ nickname;
// password
//
typedef
mysql::query_column<
mysql::value_traits<
::std::string,
mysql::id_string >::query_type,
mysql::id_string >
password_type_;
static const password_type_ password;
// register_date
//
typedef
mysql::query_column<
mysql::value_traits<
long long unsigned int,
mysql::id_ulonglong >::query_type,
mysql::id_ulonglong >
register_date_type_;
static const register_date_type_ register_date;
// kills
//
typedef
mysql::query_column<
mysql::value_traits<
unsigned int,
mysql::id_ulong >::query_type,
mysql::id_ulong >
kills_type_;
static const kills_type_ kills;
// deaths
//
typedef
mysql::query_column<
mysql::value_traits<
unsigned int,
mysql::id_ulong >::query_type,
mysql::id_ulong >
deaths_type_;
static const deaths_type_ deaths;
// joins
//
typedef
mysql::query_column<
mysql::value_traits<
unsigned int,
mysql::id_ulong >::query_type,
mysql::id_ulong >
joins_type_;
static const joins_type_ joins;
// disconnects
//
typedef
mysql::query_column<
mysql::value_traits<
unsigned int,
mysql::id_ulong >::query_type,
mysql::id_ulong >
disconnects_type_;
static const disconnects_type_ disconnects;
// kicks
//
typedef
mysql::query_column<
mysql::value_traits<
unsigned int,
mysql::id_ulong >::query_type,
mysql::id_ulong >
kicks_type_;
static const kicks_type_ kicks;
// experience
//
typedef
mysql::query_column<
mysql::value_traits<
long long unsigned int,
mysql::id_ulonglong >::query_type,
mysql::id_ulonglong >
experience_type_;
static const experience_type_ experience;
// admin
//
typedef
mysql::query_column<
mysql::value_traits<
long long unsigned int,
mysql::id_ulonglong >::query_type,
mysql::id_ulonglong >
admin_type_;
static const admin_type_ admin;
// banned
//
typedef
mysql::query_column<
mysql::value_traits<
long long unsigned int,
mysql::id_ulonglong >::query_type,
mysql::id_ulonglong >
banned_type_;
static const banned_type_ banned;
};
template <typename A>
const typename query_columns< ::user, id_mysql, A >::id_type_
query_columns< ::user, id_mysql, A >::
id (A::table_name, "`id`", 0);
template <typename A>
const typename query_columns< ::user, id_mysql, A >::nickname_type_
query_columns< ::user, id_mysql, A >::
nickname (A::table_name, "`nickname`", 0);
template <typename A>
const typename query_columns< ::user, id_mysql, A >::password_type_
query_columns< ::user, id_mysql, A >::
password (A::table_name, "`password`", 0);
template <typename A>
const typename query_columns< ::user, id_mysql, A >::register_date_type_
query_columns< ::user, id_mysql, A >::
register_date (A::table_name, "`register_date`", 0);
template <typename A>
const typename query_columns< ::user, id_mysql, A >::kills_type_
query_columns< ::user, id_mysql, A >::
kills (A::table_name, "`kills`", 0);
template <typename A>
const typename query_columns< ::user, id_mysql, A >::deaths_type_
query_columns< ::user, id_mysql, A >::
deaths (A::table_name, "`deaths`", 0);
template <typename A>
const typename query_columns< ::user, id_mysql, A >::joins_type_
query_columns< ::user, id_mysql, A >::
joins (A::table_name, "`joins`", 0);
template <typename A>
const typename query_columns< ::user, id_mysql, A >::disconnects_type_
query_columns< ::user, id_mysql, A >::
disconnects (A::table_name, "`disconnects`", 0);
template <typename A>
const typename query_columns< ::user, id_mysql, A >::kicks_type_
query_columns< ::user, id_mysql, A >::
kicks (A::table_name, "`kicks`", 0);
template <typename A>
const typename query_columns< ::user, id_mysql, A >::experience_type_
query_columns< ::user, id_mysql, A >::
experience (A::table_name, "`experience`", 0);
template <typename A>
const typename query_columns< ::user, id_mysql, A >::admin_type_
query_columns< ::user, id_mysql, A >::
admin (A::table_name, "`admin`", 0);
template <typename A>
const typename query_columns< ::user, id_mysql, A >::banned_type_
query_columns< ::user, id_mysql, A >::
banned (A::table_name, "`banned`", 0);
template <typename A>
struct pointer_query_columns< ::user, id_mysql, A >:
query_columns< ::user, id_mysql, A >
{
};
template <>
class access::object_traits_impl< ::user, id_mysql >:
public access::object_traits< ::user >
{
public:
struct id_image_type
{
unsigned long long id_value;
my_bool id_null;
std::size_t version;
};
struct image_type
{
// id_
//
unsigned long long id_value;
my_bool id_null;
// nickname_
//
details::buffer nickname_value;
unsigned long nickname_size;
my_bool nickname_null;
// password_
//
details::buffer password_value;
unsigned long password_size;
my_bool password_null;
// register_date_
//
unsigned long long register_date_value;
my_bool register_date_null;
// kills_
//
unsigned int kills_value;
my_bool kills_null;
// deaths_
//
unsigned int deaths_value;
my_bool deaths_null;
// joins_
//
unsigned int joins_value;
my_bool joins_null;
// disconnects_
//
unsigned int disconnects_value;
my_bool disconnects_null;
// kicks_
//
unsigned int kicks_value;
my_bool kicks_null;
// experience_
//
unsigned long long experience_value;
my_bool experience_null;
// admin_
//
unsigned long long admin_value;
my_bool admin_null;
// banned_
//
unsigned long long banned_value;
my_bool banned_null;
std::size_t version;
};
// bans_
//
struct bans_traits
{
static const std::size_t id_column_count = 1UL;
static const std::size_t data_column_count = 2UL;
static const char insert_statement[];
static const char select_statement[];
static const char delete_statement[];
typedef ::user::bans_type container_type;
typedef
odb::access::container_traits<container_type>
container_traits_type;
typedef container_traits_type::index_type index_type;
typedef container_traits_type::value_type value_type;
typedef ordered_functions<index_type, value_type> functions_type;
typedef mysql::container_statements< bans_traits > statements_type;
struct data_image_type
{
// index
//
unsigned long long index_value;
my_bool index_null;
// value
//
composite_value_traits< value_type, id_mysql >::image_type value_value;
std::size_t version;
};
static void
bind (MYSQL_BIND*,
const MYSQL_BIND* id,
std::size_t id_size,
data_image_type&);
static void
grow (data_image_type&, my_bool*);
static void
init (data_image_type&, index_type*, const value_type&);
static void
init (index_type&, value_type&, const data_image_type&, database*);
static void
insert (index_type, const value_type&, void*);
static bool
select (index_type&, value_type&, void*);
static void
delete_ (void*);
static void
persist (const container_type&, statements_type&);
static void
load (container_type&, statements_type&);
static void
update (const container_type&, statements_type&);
static void
erase (statements_type&);
};
using object_traits<object_type>::id;
static id_type
id (const image_type&);
static bool
grow (image_type&, my_bool*);
static void
bind (MYSQL_BIND*,
image_type&,
mysql::statement_kind);
static void
bind (MYSQL_BIND*, id_image_type&);
static bool
init (image_type&, const object_type&, mysql::statement_kind);
static void
init (object_type&, const image_type&, database*);
static void
init (id_image_type&, const id_type&);
typedef mysql::object_statements<object_type> statements_type;
typedef mysql::query_base query_base_type;
struct container_statement_cache_type;
static const std::size_t column_count = 12UL;
static const std::size_t id_column_count = 1UL;
static const std::size_t inverse_column_count = 0UL;
static const std::size_t readonly_column_count = 0UL;
static const std::size_t managed_optimistic_column_count = 0UL;
static const char persist_statement[];
static const char find_statement[];
static const char update_statement[];
static const char erase_statement[];
static const char query_statement[];
static const char erase_query_statement[];
static const char table_name[];
static void
persist (database&, object_type&);
static pointer_type
find (database&, const id_type&);
static bool
find (database&, const id_type&, object_type&);
static bool
reload (database&, object_type&);
static void
update (database&, const object_type&);
static void
erase (database&, const id_type&);
static void
erase (database&, const object_type&);
static result<object_type>
query (database&, const query_base_type&);
static unsigned long long
erase_query (database&, const query_base_type&);
public:
static bool
find_ (statements_type&, const id_type*);
static void
load_ (statements_type&, object_type&);
};
template <>
class access::object_traits_impl< ::user, id_common >:
public access::object_traits_impl< ::user, id_mysql >
{
};
// user
//
}
#include "user-odb.ixx"
#include <odb/post.hxx>
#endif // USER_ODB_HXX