GeezerVison is showing github.com — 0.9.6-SNAPSHOT, VS updates, @Relation · MasterAlpha/objectbox-java@c1af775
File tree
Expand file treeCollapse file tree
Open diff view settings
objectbox-java-api/src/main/java/io/objectbox/annotation objectbox-java/src/main/java/io/objectbox
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/Entity.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
36 | 36 | // |
37 | 37 | // /** |
38 | 38 | // * Whether update/delete/refresh methods should be generated. |
39 | | -// * If entity has defined {@link ToMany} or {@link io.objectbox.annotation.ToOne} relations, then it is active independently from this value |
| 39 | +// * If entity has defined {@link Relation}, then it is active independently from this value |
40 | 40 | // */ |
41 | 41 | // boolean active() default false; |
42 | 42 | // |
|
Collapse file
Copy file name to clipboardExpand all lines: objectbox-java-api/src/main/java/io/objectbox/annotation/JoinProperty.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
7 | 7 | /** |
8 | 8 | * Defines name and referencedName properties for relations |
9 | 9 | * |
10 | | - * @see ToMany |
| 10 | + * @see Relation |
11 | 11 | */ |
12 | 12 | @Retention(RetentionPolicy.CLASS) |
13 | 13 | @Target({}) |
|
Collapse file
Copy file name to clipboardExpand all lines: objectbox-java-api/src/main/java/io/objectbox/annotation/OrderBy.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
6 | 6 | import java.lang.annotation.Target; |
7 | 7 |
|
8 | 8 | /** |
9 | | - * Specifies ordering of related collection of {@link ToMany} relation |
| 9 | + * Specifies ordering of related collection of {@link Relation} relation |
10 | 10 | * E.g.: @OrderBy("name, age DESC") List collection; |
11 | 11 | * If used as marker (@OrderBy List collection), then collection is ordered by primary key |
12 | 12 | */ |
|
Collapse file
Copy file name to clipboardExpand all lines: objectbox-java-api/src/main/java/io/objectbox/annotation/Property.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
7 | 7 |
|
8 | 8 | /** |
9 | 9 | * Optional: configures the mapped column for a persistent field. |
10 | | - * This annotation is also applicable with @ToOne without additional foreign key property |
| 10 | + * This annotation is also applicable with @Relation without additional foreign key property |
11 | 11 | */ |
12 | 12 | @Retention(RetentionPolicy.CLASS) |
13 | 13 | @Target(ElementType.FIELD) |
|
Collapse file
Copy file name to clipboard +27Lines changed: 27 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 | +import io.objectbox.annotation.apihint.Beta; |
| 9 | + |
| 10 | +/** |
| 11 | + * Marks the property (typ must be an entity or a List of entities) as a relation (optional?). |
| 12 | + */ |
| 13 | +@Retention(RetentionPolicy.CLASS) |
| 14 | +@Target(ElementType.FIELD) |
| 15 | +@Beta |
| 16 | +public @interface Relation { |
| 17 | + /** |
| 18 | + * Name of the property holding the id (key) as a base for this relation. |
| 19 | + * <p> |
| 20 | + * For to-one relations, the id property must reside in the same entity. |
| 21 | + * <p> |
| 22 | + * For to-many relations, the id must reside in the target entity as part of a to-one @Relation. This implies that |
| 23 | + * to-many relations require a to-one relation in the target entity pointing to this entity. |
| 24 | + * <p> |
| 25 | + */ |
| 26 | + String idProperty() default ""; |
| 27 | +} |
Collapse file
Copy file name to clipboardExpand all lines: objectbox-java-api/src/main/java/io/objectbox/annotation/ToMany.java -25Lines changed: 0 additions & 25 deletions Collapse file
Copy file name to clipboardExpand all lines: objectbox-java-api/src/main/java/io/objectbox/annotation/ToOne.java -19Lines changed: 0 additions & 19 deletions Collapse file
Copy file name to clipboardExpand all lines: objectbox-java/src/main/java/io/objectbox/BoxStore.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -152,7 +152,7 @@ static native void nativeRegisterCustomType(long store, int entityId, int proper |
152 | 152 | static native int nativeCleanStaleReadTransactions(long store); |
153 | 153 |
|
154 | 154 | public static String getVersion() { |
155 | | - return "0.9.4-20161212"; |
| 155 | + return "0.9.6-2017-01-11"; |
156 | 156 | } |
157 | 157 |
|
158 | 158 | private final File directory; |
|