objectbox-java icon indicating copy to clipboard operation
objectbox-java copied to clipboard

I have a big project using Realm and I am porting this and future projects to ObjectBox.

Open LeonardDaVinci opened this issue 11 months ago • 1 comments

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 !

LeonardDaVinci avatar Dec 27 '24 15:12 LeonardDaVinci

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.

greenrobot-team avatar Jan 13 '25 10:01 greenrobot-team

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.

github-actions[bot] avatar Oct 16 '25 01:10 github-actions[bot]