GeezerVison is showing github.com — API_ added @TargetIdProperty, deprecated old annotations · a200332/objectbox-java@934e3ab
File tree
Expand file treeCollapse file tree
Open diff view settings
objectbox-java-api/src/main/java/io/objectbox/annotation
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: objectbox-java-api/src/main/java/io/objectbox/annotation/Backlink.java +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
12 | 12 | * <p> |
13 | 13 | * Example: one "Order" references one "Customer" (to-one relation). |
14 | 14 | * The backlink to this is a to-many in the reverse direction: one "Customer" has a number of "Order"s. |
| 15 | + * |
| 16 | + * Note: backlinks to to-many relations will be supported in the future. |
15 | 17 | */ |
16 | 18 | @Retention(RetentionPolicy.CLASS) |
17 | 19 | @Target(ElementType.FIELD) |
|
Collapse file
Copy file name to clipboardExpand all lines: objectbox-java-api/src/main/java/io/objectbox/annotation/Generated.java +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
14 | 14 | */ |
15 | 15 | @Retention(RetentionPolicy.CLASS) |
16 | 16 | @Target({ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.METHOD}) |
| 17 | +@Deprecated |
17 | 18 | public @interface Generated { |
18 | 19 | /** A hash to identify the generated code */ |
19 | 20 | int value() default -1; |
|
Collapse file
Copy file name to clipboardExpand all lines: objectbox-java-api/src/main/java/io/objectbox/annotation/Keep.java +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
20 | 20 | */ |
21 | 21 | @Retention(RetentionPolicy.CLASS) |
22 | 22 | @Target({ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE}) |
| 23 | +@Deprecated |
23 | 24 | public @interface Keep { |
24 | 25 | } |
Collapse file
Copy file name to clipboardExpand all lines: objectbox-java-api/src/main/java/io/objectbox/annotation/Relation.java +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
16 | 16 | @Target(ElementType.FIELD) |
17 | 17 | @Beta |
18 | 18 | @Temporary |
| 19 | +@Deprecated |
19 | 20 | public @interface Relation { |
20 | 21 | /** |
21 | 22 | * Name of the property (in the source entity) holding the id (key) as a base for this to-one relation. |
|
Collapse file
Copy file name to clipboard +20Lines changed: 20 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +package io.objectbox.annotation; |
| 2 | + |
| 3 | +import java.lang.annotation.ElementType; |
| 4 | +import java.lang.annotation.Retention; |
| 5 | +import java.lang.annotation.RetentionPolicy; |
| 6 | +import java.lang.annotation.Target; |
| 7 | + |
| 8 | +/** |
| 9 | + * Defines the property serving as the target ID of a ToOne. |
| 10 | + * This allows exposing an explicit property, which may be convenient for other parsers/serializers (e.g. JSON). |
| 11 | + */ |
| 12 | +@Retention(RetentionPolicy.CLASS) |
| 13 | +@Target({ElementType.FIELD, ElementType.TYPE}) |
| 14 | +public @interface TargetIdProperty { |
| 15 | + /** |
| 16 | + * Name used in the database. |
| 17 | + */ |
| 18 | + String value(); |
| 19 | + |
| 20 | +} |