#include "../database_types.h"
#include "../core/database_backend.h"
#include <string>
#include <vector>
#include <memory>
#include <type_traits>
#include <chrono>
#include <unordered_map>
#include <functional>
#include <mutex>
#include <optional>
Go to the source code of this file.
◆ ENTITY_FIELD
| #define ENTITY_FIELD |
( |
| type, |
|
|
| name, |
|
|
| ... ) |
Value: private: \
type name##_; \
static inline field_metadata name##_metadata_{#name, #type, __VA_ARGS__}; \
public: \
field_accessor<type> name{name##_, name##_metadata_}; \
static const field_metadata& name##_field() { return name##_metadata_; }
- Examples
- orm_framework_demo.cpp.
Definition at line 274 of file entity.h.
274 #define ENTITY_FIELD(type, name, ...) \
275 private: \
276 type name##_; \
277 static inline field_metadata name##_metadata_{#name, #type, __VA_ARGS__}; \
278 public: \
279 field_accessor<type> name{name##_, name##_metadata_}; \
280 static const field_metadata& name##_field() { return name##_metadata_; }
◆ ENTITY_METADATA
| #define ENTITY_METADATA |
( |
| ) |
|
Value: public: \
const entity_metadata& get_metadata() const override { \
static std::once_flag init_flag; \
std::call_once(init_flag, [this]() { initialize_metadata(); }); \
return metadata_; \
} \
private: \
static void initialize_metadata();
- Examples
- orm_framework_demo.cpp.
Definition at line 289 of file entity.h.
289 #define ENTITY_METADATA() \
290 public: \
291 const entity_metadata& get_metadata() const override { \
292 static std::once_flag init_flag; \
293 std::call_once(init_flag, [this]() { initialize_metadata(); }); \
294 return metadata_; \
295 } \
296 private: \
297 static void initialize_metadata();
◆ ENTITY_TABLE
| #define ENTITY_TABLE |
( |
| table_name | ) |
|
Value: public: \
std::string table_name() const override { return table_name; } \
using primary_key_type = decltype(id_); \
private: \
static inline entity_metadata metadata_{table_name};
- Examples
- orm_framework_demo.cpp.
Definition at line 282 of file entity.h.
282 #define ENTITY_TABLE(table_name) \
283 public: \
284 std::string table_name() const override { return table_name; } \
285 using primary_key_type = decltype(id_); \
286 private: \
287 static inline entity_metadata metadata_{table_name};