Id class Null safety

Annotation Id can be used to specify an entity ID property if it's named anything else then "id" (case insensitive).


Id({bool assignable = false})
Create an Id annotation.


assignable bool
When you put a new object you don't assign an ID by default, it's assigned automatically by ObjectBox. If you need to assign IDs by yourself, use the @Id(assignable: true) annotation. This will allow putting an object with any valid ID. You can still set the ID to zero an leave it to ObjectBox. Note: in case you use assignable IDs on relation targets (with ToOne or ToMany), you're responsible for inserting new target objects before the source. If new objects have non-zero IDs ObjectBox has no way of telling which objects are new and which are already saved.
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


noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
toString() String
A string representation of this object.


operator ==(Object other) bool
The equality operator.