I am fetching orders from a backend that has two endpoints, one for fetching a limited number of orders and one for fetching simply the number of total orders available. I can store the orders using a CustomerOrder entity class but how can I store the primitive count value?
Since ObjectBox will not allow boxes of primitive types and requires using entity classes I had to wrap a single (!) Integer inside an entity class. Maybe there is a simpler way to do this?
What does not work but what I basically want to do:
Box<Integer> countBox = boxStore.boxFor(Integer.class);
My current entity wrapper class (still only uses 1 row in the table):
@Entity
public class CustomerOrderCount {
@Id
public Integer count;
}
I simply want to follow best practices and simplify things. Maybe there is an even easier method than using ObjectBox that is still legit that I am not seeing here.