uid property

int? uid
final

ObjectBox keeps track of entities and properties by assigning them unique identifiers, UIDs, during the code-generation phase. All those UIDs are stored in a file objectbox-model.json in your package and are looked up by name. If the name changes a new uid is assigned, effectively creating a new Entity in the database.

If you explicitly specify a uid on an Entity, ObjectBox would be able to identify it even after you change the name and would update the database accordingly on the next application launch - renaming the stored Entity instead of creating a new one.

Implementation

final int? uid;