Package io.objectbox.annotation
Annotation Type Sync
-
@Retention(CLASS) @Target(TYPE) public @interface SyncEnables sync for anEntityclass.Note that currently sync can not be enabled or disabled for existing entities. Also synced entities can not have relations to non-synced entities.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleansharedGlobalIds
-
-
-
Element Detail
-
sharedGlobalIds
boolean sharedGlobalIds
Set totrueto enable shared global IDs for aSync-enabledEntityclass.By default each Sync client has its own local
IDspace for Objects. IDs are mapped to global IDs when syncing behind the scenes. Turn this on to treat Object IDs as global and turn of ID mapping. The ID of an Object will then be the same on all clients.When using this, it is recommended to use
assignable IDsto turn off automatically assigned IDs. Without special care, two Sync clients are likely to overwrite each others Objects if IDs are assigned automatically.- Default:
- false
-
-