objectbox-java
objectbox-java copied to clipboard
I have a big project using Realm and I am porting this and future projects to ObjectBox.
Until now, everything is working ok. I have only ONE big problem, I am trying for many days any possible solution, but I cannot solve it.
This was using Realm private RealmList<ItemCartOl> listItemCartOl;
public OderHistoryOl() {
}
public OderHistoryOl(String status,String orderPrice, String name, String phone, String paymentMethod, String time, String address, String id, String type, String tableId, String seats, RealmList<ItemCartOl> listItemCartOl) {
this.status = status;
this.name = name;
this.phone = phone;
this.paymentMethod = paymentMethod;
this.time = time;
this.address = address;
this.id = id;
this.type = type;
this.tableId = tableId;
this.seats = seats;
this.listItemCartOl = listItemCartOl;
this.orderPrice = orderPrice;
}
This I try with Objectbox private List<ItemCartOl> listItemCartOl;
public OderHistoryOl() {
}
public OderHistoryOl(String status, String orderPrice, String name, String phone, String paymentMethod, String time, String address, String id, String type, String tableId, String seats, ArrayList<ItemCartOl> lstItemCartOl) {
this.status = status;
this.name = name;
this.phone = phone;
this.paymentMethod = paymentMethod;
this.time = time;
this.address = address;
this.id = id;
this.type = type;
this.tableId = tableId;
this.seats = seats;
this.orderPrice = orderPrice;
this.listItemCartOl = new ArrayList<ItemCartOl>(lstItemCartOl);
}
The problem is that listItemCartOl ha size = 0 when I try to load OderHistoryOl !
RealmList appears to be a to-many relation. To do that in ObjectBox see https://docs.objectbox.io/relations#to-many-relations.
Note: I labeled this issue with "more info required" so it will auto-close in a few days if there are no follow-up comments.
Without additional information, we are unfortunately not sure how to resolve this issue. Therefore this issue has been automatically closed. Feel free to comment with additional details and we can re-open this issue.