0

I am trying to find a way to insert a child object in its parent object without having to do a query for each one.
Let me be more specific:

class Parent extends RealmObject {
   String id;
   RealmList<Child> childs;
}
class Child extends RealmObject {
   String parentId;
}

And suppose I make a request in a webservice to get child object of different parents... so, now I have:

List<Child> childsOfDifferentParents;

And I want to add to link each child to its correct parent.

The only way I've found so far was, query for each parent and add it.
But, since it is too many objects, it wouldn't be efficient. What should I do?

reinaldomoreira
  • 5,388
  • 3
  • 14
  • 29

0 Answers0