Package io.objectbox.model
Class Model
java.lang.Object
io.objectbox.flatbuffers.Table
io.objectbox.model.Model
A model describes all entities and other meta data.
The current model of an app is synced against ObjectBox's persisted schema.
The model itself is not persisted, and thus may change as long as both ends are consistent (Java and native).
There could be multiple models/schemas (one dbi per schema) in the future.
-
Nested Class Summary
Nested Classes -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription__assign(int _i, ByteBuffer _bb) void__init(int _i, ByteBuffer _bb) static voidaddEntities(FlatBufferBuilder builder, int entitiesOffset) static voidaddHash(FlatBufferBuilder builder, int hashOffset) static voidaddLastEntityId(FlatBufferBuilder builder, int lastEntityIdOffset) static voidaddLastIndexId(FlatBufferBuilder builder, int lastIndexIdOffset) static voidaddLastRelationId(FlatBufferBuilder builder, int lastRelationIdOffset) static voidaddLastSequenceId(FlatBufferBuilder builder, int lastSequenceIdOffset) static voidaddModelVersion(FlatBufferBuilder builder, long modelVersion) static voidaddName(FlatBufferBuilder builder, int nameOffset) static voidaddVersion(FlatBufferBuilder builder, long version) static intcreateEntitiesVector(FlatBufferBuilder builder, int[] data) static intcreateHashVector(FlatBufferBuilder builder, byte[] data) static intcreateHashVector(FlatBufferBuilder builder, ByteBuffer data) static intendModel(FlatBufferBuilder builder) entities(int j) entities(ModelEntity obj, int j) intstatic voidfinishModelBuffer(FlatBufferBuilder builder, int offset) static voidfinishSizePrefixedModelBuffer(FlatBufferBuilder builder, int offset) static ModelgetRootAsModel(ByteBuffer _bb) static ModelgetRootAsModel(ByteBuffer _bb, Model obj) inthash(int j) Hash of the model/schema; usually want to check hashes before even creating a model and thus avoiding creating the model altogether.inthashVector(ByteVector obj) lastEntityId(IdUid obj) lastIndexId(IdUid obj) lastRelationId(IdUid obj) lastSequenceId(IdUid obj) long(Meta) version of the model, which is verified by model sync (e.g.name()currently always "default"static voidstartEntitiesVector(FlatBufferBuilder builder, int numElems) static voidstartHashVector(FlatBufferBuilder builder, int numElems) static voidstartModel(FlatBufferBuilder builder) static voidlongversion()User controlled version, not really used at the momentMethods inherited from class io.objectbox.flatbuffers.Table
__has_identifier, __indirect, __indirect, __offset, __offset, __reset, __reset, __string, __string, __union, __union, __vector, __vector_as_bytebuffer, __vector_in_bytebuffer, __vector_len, compareStrings, compareStrings, getByteBuffer, keysCompare, sortTables
-
Constructor Details
-
Model
public Model()
-
-
Method Details
-
ValidateVersion
public static void ValidateVersion() -
getRootAsModel
-
getRootAsModel
-
__init
-
__assign
-
modelVersion
public long modelVersion()(Meta) version of the model, which is verified by model sync (e.g. Java version must match native version) -
name
currently always "default" -
nameAsByteBuffer
-
nameInByteBuffer
-
version
public long version()User controlled version, not really used at the moment -
entities
-
entities
-
entitiesLength
public int entitiesLength() -
entitiesVector
-
entitiesVector
-
lastEntityId
-
lastEntityId
-
lastIndexId
-
lastIndexId
-
lastSequenceId
-
lastSequenceId
-
lastRelationId
-
lastRelationId
-
hash
public int hash(int j) Hash of the model/schema; usually want to check hashes before even creating a model and thus avoiding creating the model altogether. But, at least for now, let language bindings provide it via the model optionally. We use SipHash 128 (16 bytes). -
hashLength
public int hashLength() -
hashVector
-
hashVector
-
hashAsByteBuffer
-
hashInByteBuffer
-
startModel
-
addModelVersion
-
addName
-
addVersion
-
addEntities
-
createEntitiesVector
-
startEntitiesVector
-
addLastEntityId
-
addLastIndexId
-
addLastSequenceId
-
addLastRelationId
-
addHash
-
createHashVector
-
createHashVector
-
startHashVector
-
endModel
-
finishModelBuffer
-
finishSizePrefixedModelBuffer
-