ModelInfo class

In order to represent the model stored in objectbox-model.json in Dart, several classes have been introduced. Conceptually, these classes are comparable to how models are handled in ObjectBox Java and ObjectBox Go; eventually, ObjectBox Dart models will be fully compatible to them. This is also why for explanations on most concepts related to ObjectBox models, you can refer to the existing documentation.

Constructors

ModelInfo({List<ModelEntity> entities, IdUid lastEntityId, IdUid lastIndexId, IdUid lastRelationId, IdUid lastSequenceId, List<int> retiredEntityUids, List<int> retiredIndexUids, List<int> retiredPropertyUids, List<int> retiredRelationUids, int modelVersion, int modelVersionParserMinimum, int version})
ModelInfo.createDefault()
ModelInfo.fromMap(Map<String, dynamic> data, {bool check: true})

Properties

entities ↔ List<ModelEntity>
read / write
lastEntityId IdUid
read / write
lastIndexId IdUid
read / write
lastRelationId IdUid
read / write
lastSequenceId IdUid
read / write
modelVersion ↔ int
read / write
modelVersionParserMinimum ↔ int
read / write
retiredEntityUids ↔ List<int>
read / write
retiredIndexUids ↔ List<int>
read / write
retiredPropertyUids ↔ List<int>
read / write
retiredRelationUids ↔ List<int>
read / write
version ↔ int
read / write
hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

addEntity(ModelEntity other) ModelEntity
containsUid(int uid) → bool
createEntity(String name, [int uid = 0]) ModelEntity
findEntityByName(String name) ModelEntity
findEntityByUid(int uid) ModelEntity
findSameEntity(ModelEntity other) ModelEntity
generateUid() → int
removeEntity(ModelEntity entity) → void
toMap({bool forCodeGen: false}) → Map<String, dynamic>
validate() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited

Constants

notes → const List<String>
const ['KEEP THIS FILE! Check it into a version control system (VCS) like git.', 'ObjectBox manages crucial IDs for your object model. See docs for details.', 'If you have VCS merg…