GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Shared IDs: add property on Sync annotation. · TinyAndNeo/objectbox-java@144f004

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • objectbox-java-api/src/main/java/io/objectbox/annotation
    • Sync.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎objectbox-java-api/src/main/java/io/objectbox/annotation/Sync.java‎

Copy file name to clipboardExpand all lines: objectbox-java-api/src/main/java/io/objectbox/annotation/Sync.java
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,18 @@
1414
@Retention(RetentionPolicy.CLASS)
1515
@Target(ElementType.TYPE)
1616
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;
1731
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.