-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathobjectbox-model.h
40 lines (34 loc) · 1.73 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
// 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, 6645479796472661392);
obx_model_property(model, "id", OBXPropertyType_Long, 1, 9211738071025439652);
obx_model_property_flags(model, OBXPropertyFlags_ID);
obx_model_property(model, "text", OBXPropertyType_String, 2, 8804670454579230281);
obx_model_property(model, "date_created", OBXPropertyType_Date, 4, 1260602348787983453);
obx_model_property(model, "date_finished", OBXPropertyType_Date, 5, 6240065879507520219);
obx_model_entity_last_property_id(model, 5, 6240065879507520219);
obx_model_last_entity_id(model, 1, 6645479796472661392);
return model; // NOTE: the returned model will contain error information if an error occurred.
}
#ifdef __cplusplus
}
#endif