|
28 | 28 | import javax.annotation.Nullable;
|
29 | 29 | import javax.annotation.concurrent.ThreadSafe;
|
30 | 30 |
|
| 31 | +import io.objectbox.annotation.Backlink; |
31 | 32 | import io.objectbox.annotation.Id;
|
32 | 33 | import io.objectbox.annotation.apihint.Beta;
|
33 | 34 | import io.objectbox.annotation.apihint.Experimental;
|
@@ -344,19 +345,19 @@ public boolean contains(long id) {
|
344 | 345 | * available ID. For example, if there is an object with ID 1 and another with ID 100, it will be assigned ID 101.
|
345 | 346 | * The new ID is also set on the given object before this returns.
|
346 | 347 | * <p>
|
347 |
| - * If instead the object has an assigned ID set, if an object with the same ID exists it will be updated. |
348 |
| - * Otherwise, it will be inserted with that ID. |
| 348 | + * If instead the object has an assigned ID set, if an object with the same ID exists it is updated. Otherwise, it |
| 349 | + * is inserted with that ID. |
349 | 350 | * <p>
|
350 | 351 | * If the ID was not assigned before an {@link IllegalArgumentException} is thrown.
|
351 | 352 | * <p>
|
352 | 353 | * When the object contains {@link ToOne} or {@link ToMany} relations, they are created (or updated) to point to the
|
353 |
| - * (new) target objects. |
354 |
| - * The target objects themselves are not updated or removed. To do so, put or remove them using their box. |
355 |
| - * However, for convenience, if a target object is new, it will be inserted and assigned an ID in its box before |
356 |
| - * creating or updating the relation. |
| 354 | + * (new) target objects. The target objects themselves are typically not updated or removed. To do so, put or remove |
| 355 | + * them using their {@link Box}. However, for convenience, if a target object is new, it will be inserted and |
| 356 | + * assigned an ID in its Box before creating or updating the relation. Also, for ToMany relations based on a |
| 357 | + * {@link Backlink} the target objects are updated (to store changes in the linked ToOne or ToMany relation). |
357 | 358 | * <p>
|
358 |
| - * Performance note: if you want to put several objects, consider {@link #put(Collection)}, |
359 |
| - * {@link #put(Object[])}, {@link BoxStore#runInTx(Runnable)}, etc. instead. |
| 359 | + * Performance note: if you want to put several objects, consider {@link #put(Collection)}, {@link #put(Object[])}, |
| 360 | + * {@link BoxStore#runInTx(Runnable)}, etc. instead. |
360 | 361 | */
|
361 | 362 | public long put(T entity) {
|
362 | 363 | Cursor<T> cursor = getWriter();
|
|
0 commit comments