@@ -193,8 +193,8 @@ private void ensureBoxes() {
193
193
try {
194
194
boxStore = (BoxStore ) boxStoreField .get (entity );
195
195
if (boxStore == null ) {
196
- throw new DbDetachedException ("Cannot resolve relation for detached entities , " +
197
- "call box.attach(entity ) beforehand." );
196
+ throw new DbDetachedException ("Cannot resolve relation for detached objects , " +
197
+ "call box.attach(object ) beforehand." );
198
198
}
199
199
} catch (IllegalAccessException e ) {
200
200
throw new RuntimeException (e );
@@ -570,9 +570,9 @@ public int getRemoveCount() {
570
570
}
571
571
572
572
/**
573
- * Sorts the list by the "natural" ObjectBox order for to-many list (by entity ID).
574
- * This will be the order when you get the entities fresh (e.g. initially or after calling {@link #reset()}).
575
- * Note that non persisted entities (ID is zero) will be put to the end as they are still to get an ID.
573
+ * Sorts the list by the "natural" ObjectBox order for to-many list (by object ID).
574
+ * This will be the order when you get the objects fresh (e.g. initially or after calling {@link #reset()}).
575
+ * Note that non persisted objects (ID is zero) will be put to the end as they are still to get an ID.
576
576
*/
577
577
public void sortById () {
578
578
ensureEntities ();
@@ -601,7 +601,7 @@ else if (delta > 0)
601
601
}
602
602
603
603
/**
604
- * Saves changes (added and removed entities ) made to this relation to the database. For some important details, see
604
+ * Saves changes (added and removed objects ) made to this relation to the database. For some important details, see
605
605
* the notes about relations of {@link Box#put(Object)}.
606
606
* <p>
607
607
* Note that this is called already when the object that contains this ToMany is put. However, if only this ToMany
@@ -614,12 +614,12 @@ public void applyChangesToDb() {
614
614
long id = relationInfo .sourceInfo .getIdGetter ().getId (entity );
615
615
if (id == 0 ) {
616
616
throw new IllegalStateException (
617
- "The source entity was not yet persisted (no ID), use box.put() on it instead" );
617
+ "The object with the ToMany was not yet persisted (no ID), use box.put() on it instead" );
618
618
}
619
619
try {
620
620
ensureBoxes ();
621
621
} catch (DbDetachedException e ) {
622
- throw new IllegalStateException ("The source entity was not yet persisted, use box.put() on it instead" );
622
+ throw new IllegalStateException ("The object with the ToMany was not yet persisted, use box.put() on it instead" );
623
623
}
624
624
if (internalCheckApplyToDbRequired ()) {
625
625
// We need a TX because we use two writers and both must use same TX (without: unchecked, SIGSEGV)
@@ -632,10 +632,10 @@ public void applyChangesToDb() {
632
632
}
633
633
634
634
/**
635
- * Returns true if at least one of the entities matches the given filter.
635
+ * Returns true if at least one of the target objects matches the given filter.
636
636
* <p>
637
637
* For use with {@link QueryBuilder#filter(QueryFilter)} inside a {@link QueryFilter} to check
638
- * to-many relation entities .
638
+ * to-many relation objects .
639
639
*/
640
640
@ Beta
641
641
public boolean hasA (QueryFilter <TARGET > filter ) {
@@ -650,10 +650,10 @@ public boolean hasA(QueryFilter<TARGET> filter) {
650
650
}
651
651
652
652
/**
653
- * Returns true if all of the entities match the given filter. Returns false if the list is empty.
653
+ * Returns true if all of the target objects match the given filter. Returns false if the list is empty.
654
654
* <p>
655
655
* For use with {@link QueryBuilder#filter(QueryFilter)} inside a {@link QueryFilter} to check
656
- * to-many relation entities .
656
+ * to-many relation objects .
657
657
*/
658
658
@ Beta
659
659
public boolean hasAll (QueryFilter <TARGET > filter ) {
@@ -670,7 +670,7 @@ public boolean hasAll(QueryFilter<TARGET> filter) {
670
670
return true ;
671
671
}
672
672
673
- /** Gets an object by its entity ID. */
673
+ /** Gets an object by its ID. */
674
674
@ Beta
675
675
public TARGET getById (long id ) {
676
676
ensureEntities ();
@@ -685,7 +685,7 @@ public TARGET getById(long id) {
685
685
return null ;
686
686
}
687
687
688
- /** Gets the index of the object with the given entity ID. */
688
+ /** Gets the index of the object with the given ID. */
689
689
@ Beta
690
690
public int indexOfId (long id ) {
691
691
ensureEntities ();
@@ -704,7 +704,7 @@ public int indexOfId(long id) {
704
704
705
705
/**
706
706
* Returns true if there are pending changes for the DB.
707
- * Changes will be automatically persisted once the owning entity is put, or an explicit call to
707
+ * Changes will be automatically persisted once the object with the ToMany is put, or an explicit call to
708
708
* {@link #applyChangesToDb()} is made.
709
709
*/
710
710
public boolean hasPendingDbChanges () {
@@ -719,7 +719,7 @@ public boolean hasPendingDbChanges() {
719
719
720
720
/**
721
721
* For internal use only; do not use in your app.
722
- * Called after relation source entity is put (so we have its ID).
722
+ * Called after relation source object is put (so we have its ID).
723
723
* Prepares data for {@link #internalApplyToDb(Cursor, Cursor)}
724
724
*/
725
725
@ Internal
@@ -743,7 +743,7 @@ public boolean internalCheckApplyToDbRequired() {
743
743
// Relation based on Backlink
744
744
long entityId = relationInfo .sourceInfo .getIdGetter ().getId (entity );
745
745
if (entityId == 0 ) {
746
- throw new IllegalStateException ("Source entity has no ID (should have been put before)" );
746
+ throw new IllegalStateException ("Object with the ToMany has no ID (should have been put before)" );
747
747
}
748
748
IdGetter <TARGET > idGetter = relationInfo .targetInfo .getIdGetter ();
749
749
Map <TARGET , Boolean > setAdded = this .entitiesAdded ;
@@ -917,7 +917,7 @@ public void internalApplyToDb(Cursor<?> sourceCursor, Cursor<TARGET> targetCurso
917
917
if (isStandaloneRelation ) {
918
918
long entityId = relationInfo .sourceInfo .getIdGetter ().getId (entity );
919
919
if (entityId == 0 ) {
920
- throw new IllegalStateException ("Source entity has no ID (should have been put before)" );
920
+ throw new IllegalStateException ("Object with the ToMany has no ID (should have been put before)" );
921
921
}
922
922
923
923
if (removedStandalone != null ) {
@@ -960,7 +960,7 @@ private void addStandaloneRelations(Cursor<?> cursor, long sourceEntityId, TARGE
960
960
long targetId = targetIdGetter .getId (added [i ]);
961
961
if (targetId == 0 ) {
962
962
// Paranoia
963
- throw new IllegalStateException ("Target entity has no ID (should have been put before)" );
963
+ throw new IllegalStateException ("Target object has no ID (should have been put before)" );
964
964
}
965
965
targetIds [i ] = targetId ;
966
966
}
0 commit comments