How to limit the results of a query in DB4O?

Asked

Viewed 46 times

1

How can I create a query that returns a limited number of such results like the limit mysql? I’m looking in the documentation and I can’t find.

1 answer

1

int fromIndex = 0 
int toIndex = 250;

List<MyObject> objetos = objectContainer.query(MyObject.class).subList(fromIndex, toIndex);
  • It is not ideal yet, as objectContainer.query(Myobject.class) returns all objects and right after the subList method only picks up certain Qtd that has been specified

Browser other questions tagged

You are not signed in. Login or sign up in order to post.