Skip to content

Commit c1af775

Browse files
committed
0.9.6-SNAPSHOT, VS updates, @relation
1 parent 77ca746 commit c1af775

8 files changed

Lines changed: 32 additions & 49 deletions

File tree

objectbox-java-api/src/main/java/io/objectbox/annotation/Entity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
//
3737
// /**
3838
// * 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
4040
// */
4141
// boolean active() default false;
4242
//

objectbox-java-api/src/main/java/io/objectbox/annotation/JoinProperty.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/**
88
* Defines name and referencedName properties for relations
99
*
10-
* @see ToMany
10+
* @see Relation
1111
*/
1212
@Retention(RetentionPolicy.CLASS)
1313
@Target({})

objectbox-java-api/src/main/java/io/objectbox/annotation/OrderBy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import java.lang.annotation.Target;
77

88
/**
9-
* Specifies ordering of related collection of {@link ToMany} relation
9+
* Specifies ordering of related collection of {@link Relation} relation
1010
* E.g.: @OrderBy("name, age DESC") List collection;
1111
* If used as marker (@OrderBy List collection), then collection is ordered by primary key
1212
*/

objectbox-java-api/src/main/java/io/objectbox/annotation/Property.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
/**
99
* 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
1111
*/
1212
@Retention(RetentionPolicy.CLASS)
1313
@Target(ElementType.FIELD)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
}

objectbox-java-api/src/main/java/io/objectbox/annotation/ToMany.java

Lines changed: 0 additions & 25 deletions
This file was deleted.

objectbox-java-api/src/main/java/io/objectbox/annotation/ToOne.java

Lines changed: 0 additions & 19 deletions
This file was deleted.

objectbox-java/src/main/java/io/objectbox/BoxStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ static native void nativeRegisterCustomType(long store, int entityId, int proper
152152
static native int nativeCleanStaleReadTransactions(long store);
153153

154154
public static String getVersion() {
155-
return "0.9.4-20161212";
155+
return "0.9.6-2017-01-11";
156156
}
157157

158158
private final File directory;

0 commit comments

Comments
 (0)