Annotation Interface Uid


@Retention(CLASS) @Target({FIELD,TYPE}) public @interface Uid
UIDs identify entities (and properties and relations) uniquely in the meta object model file (objectbox-model/default.json). With UIDs entities can be mapped to their meta model representation in a stable way without their name. Once a UID is set, the entity can be renamed as often as you like - ObjectBox keeps track of it automatically. Thus, it is advisable to look up the UID in the model file and use it here before renaming an entity.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    long
    The UID associated with an entity, property or relation, as found in the model file.
  • Element Details

    • value

      long value
      The UID associated with an entity, property or relation, as found in the model file.

      Special values:

      • no value, 0 or -1: the build fails with a message that shows the UID operations for this entity, property or relation.

      See the Data Model Updates documentation for details.

      Default:
      0L