0

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()?

nonson
  • 127
  • 1
  • 6

1 Answers1

1

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

Uwe - ObjectBox
  • 1,012
  • 1
  • 7
  • 11