-
Notifications
You must be signed in to change notification settings - Fork 37
/
objectbox-model.h
42 lines (36 loc) · 1.86 KB
/
objectbox-model.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Code generated by ObjectBox; DO NOT EDIT.
#pragma once
#ifdef __cplusplus
#include <cstdbool>
#include <cstdint>
extern "C" {
#else
#include <stdbool.h>
#include <stdint.h>
#endif
#include "objectbox.h"
/// Initializes an ObjectBox model for all entities.
/// The returned pointer may be NULL if the allocation failed. If the returned model is not NULL, you should check if
/// any error occurred by calling obx_model_error_code() and/or obx_model_error_message(). If an error occurred, you're
/// responsible for freeing the resources by calling obx_model_free().
/// In case there was no error when setting the model up (i.e. obx_model_error_code() returned 0), you may configure
/// OBX_store_options with the model by calling obx_opt_model() and subsequently opening a store with obx_store_open().
/// As soon as you call obx_store_open(), the model pointer is consumed and MUST NOT be freed manually.
static inline OBX_model* create_obx_model() {
OBX_model* model = obx_model();
if (!model) return NULL;
obx_model_entity(model, "Task", 1, 1139978622395651407);
obx_model_property(model, "id", OBXPropertyType_Long, 1, 6052852175666615421);
obx_model_property_flags(model, OBXPropertyFlags_ID);
obx_model_property(model, "text", OBXPropertyType_String, 2, 2217803131116660471);
obx_model_property(model, "date_created", OBXPropertyType_Date, 3, 7901967683818986922);
obx_model_property_flags(model, OBXPropertyFlags_UNSIGNED);
obx_model_property(model, "date_finished", OBXPropertyType_Date, 4, 8036043269103161827);
obx_model_property_flags(model, OBXPropertyFlags_UNSIGNED);
obx_model_entity_last_property_id(model, 4, 8036043269103161827);
obx_model_last_entity_id(model, 1, 1139978622395651407);
return model; // NOTE: the returned model will contain error information if an error occurred.
}
#ifdef __cplusplus
}
#endif