File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
objectbox-java-api/src/main/java/io/objectbox/annotation Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 14
14
@ Retention (RetentionPolicy .CLASS )
15
15
@ Target (ElementType .TYPE )
16
16
public @interface Sync {
17
+
18
+ /**
19
+ * Set to {@code true} to enable shared global IDs for a {@link Sync}-enabled {@link Entity} class.
20
+ * <p>
21
+ * By default each Sync client has its own local {@link Id ID} space for Objects.
22
+ * IDs are mapped to global IDs when syncing behind the scenes. Turn this on
23
+ * to treat Object IDs as global and turn of ID mapping. The ID of an Object will
24
+ * then be the same on all clients.
25
+ * <p>
26
+ * When using this, it is recommended to use {@link Id#assignable() assignable IDs}
27
+ * to turn off automatically assigned IDs. Without special care, two Sync clients are
28
+ * likely to overwrite each others Objects if IDs are assigned automatically.
29
+ */
30
+ boolean sharedGlobalIds () default false ;
17
31
}
You can’t perform that action at this time.
0 commit comments