How to change query condition (not parameter)?

66 Views Asked by At

I want to reuse queries, and I know it is possible to change parameter, but how does one change the condition? And do we have to always call query.close()?

1

There are 1 best solutions below

0
On BEST ANSWER

For a built query only the parameter values can be changed. To get different conditions (== new query) a new query needs to be built.

And yes, calling query.close() is recommended to immediately free used resources. However, it's fine to keep a query around if your code will use it again.

https://docs.objectbox.io/queries#reusing-queries-and-parameters