Skip to content

Commit a1e8aad

Browse files
Update docs about possibility and limitations of to-many backlink.
1 parent 6c8f6e5 commit a1e8aad

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

  • objectbox-java-api/src/main/java/io/objectbox/annotation

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,20 @@
2626
/**
2727
* Defines a backlink relation, which is based on another relation reversing the direction.
2828
* <p>
29-
* Example: one "Order" references one "Customer" (to-one relation).
29+
* Example (to-one relation): one "Order" references one "Customer".
3030
* The backlink to this is a to-many in the reverse direction: one "Customer" has a number of "Order"s.
31-
*
32-
* Note: backlinks to to-many relations will be supported in the future.
31+
* <p>
32+
* Example (to-many relation): one "Teacher" references multiple "Student"s.
33+
* The backlink to this: one "Student" has a number of "Teacher"s.
34+
* <p>
35+
* Note: changes made to a backlink relation based on a to-many relation are ignored.
3336
*/
3437
@Retention(RetentionPolicy.CLASS)
3538
@Target(ElementType.FIELD)
3639
@Beta
3740
public @interface Backlink {
3841
/**
39-
* Name of the relation the backlink should be based on (e.g. name of a ToOne property in the target entity).
42+
* Name of the relation the backlink should be based on (e.g. name of a ToOne or ToMany property in the target entity).
4043
* Can be left empty if there is just a single relation from the target to the source entity.
4144
*/
4245
String to() default "";

0 commit comments

Comments
 (0)