func (model *Model) EntityLastPropertyId(id TypeId, uid uint64) {
	if model.Error != nil {
		return
	}
	model.Error = cCall(func() C.obx_err {
		return C.obx_model_entity_last_property_id(model.cModel, C.obx_schema_id(id), C.obx_uid(uid))
	})
}
EntityLastPropertyId declares a property with the highest ID.
Used as a compatibility check when opening DB with an older model version.
package objectbox
import "C"
import (
	"fmt"
	"unsafe"
	"github.com/google/flatbuffers/go"
	"github.com/objectbox/objectbox-generator/cmd/objectbox-gogen"
)
type ObjectBinding interface {
	AddToModel(model *Model)
	GetId(object interface{}) (id uint64, err error)
	SetId(object interface{}, id uint64) error
	PutRelated(ob *ObjectBox, object interface{}, id uint64) error
	Flatten(object interface{}, fbb *flatbuffers.Builder, id uint64) error
	Load(ob *ObjectBox, bytes []byte) (interface{}, error)
	MakeSlice(capacity int) interface{}
	AppendToSlice(slice interface{}, object interface{}) (sliceNew interface{})
	GeneratorVersion() int
}
type Model struct {
	cModel *C.OBX_model
	Error  error
	currentEntity  *entity
	entitiesById   map[TypeId]*entity
	entitiesByName map[string]*entity
	lastEntityId  TypeId
	lastEntityUid uint64
	lastIndexId  TypeId
	lastIndexUid uint64
	lastRelationId  TypeId
	lastRelationUid uint64
	generatorVersion int
}
func NewModel() *Model {
	var model = &Model{
		entitiesById:   make(map[TypeId]*entity),
		entitiesByName: make(map[string]*entity),
	}
	model.Error = cCallBool(func() bool {
		model.cModel = C.obx_model()
		return model.cModel != nil
	})
	return model
}
func (model *Model) GeneratorVersion(version int) {
	if model.Error != nil {
		return
	}
	model.generatorVersion = version
}
func (model *Model) LastEntityId(id TypeId, uid uint64) {
	if model.Error != nil {
		return
	}
	model.lastEntityId = id
	model.lastEntityUid = uid
	C.obx_model_last_entity_id(model.cModel, C.obx_schema_id(id), C.obx_uid(uid))
}
func (model *Model) LastIndexId(id TypeId, uid uint64) {
	if model.Error != nil {
		return
	}
	model.lastIndexId = id
	model.lastIndexUid = uid
	C.obx_model_last_index_id(model.cModel, C.obx_schema_id(id), C.obx_uid(uid))
}
func (model *Model) LastRelationId(id TypeId, uid uint64) {
	if model.Error != nil {
		return
	}
	model.lastRelationId = id
	model.lastRelationUid = uid
	C.obx_model_last_relation_id(model.cModel, C.obx_schema_id(id), C.obx_uid(uid))
}
func (model *Model) Entity(name string, id TypeId, uid uint64) {
	if model.Error != nil {
		return
	}
	cname := C.CString(name)
	defer C.free(unsafe.Pointer(cname))
	if err := cCall(func() C.obx_err {
		return C.obx_model_entity(model.cModel, cname, C.obx_schema_id(id), C.obx_uid(uid))
	}); err != nil {
		model.Error = err
		return
	}
	model.currentEntity = &entity{
		name: name,
		id:   id,
	}
}
func (model *Model) EntityFlags(entityFlags int) {
	if model.Error != nil {
		return
	}
	model.Error = cCall(func() C.obx_err {
		return C.obx_model_entity_flags(model.cModel, C.OBXEntityFlags(entityFlags))
	})
}
func (model *Model) Relation(relationId TypeId, relationUid uint64, targetEntityId TypeId, targetEntityUid uint64) {
	if model.Error != nil {
		return
	}
	model.Error = cCall(func() C.obx_err {
		return C.obx_model_relation(model.cModel, C.obx_schema_id(relationId), C.obx_uid(relationUid),
			C.obx_schema_id(targetEntityId), C.obx_uid(targetEntityUid))
	})
	model.currentEntity.hasRelations = true
}