I have a CAR entity with a BRAND property coded with a long.
I want to know how many distinct BRANDS there are in the table.
With SqlLite/GreenDAO I do that with
SELECT COUNT (DISTINCT column) FROM tablename
With ObjectBox I arrived to
long[] ids = App.shBox.query().build().property(Car_.companyId).distinct().findLongs();
and the length of the array is my result.
There is a better way to obtain the same result?
I'd expect to use
App.shBox.query().build().property(Car_.companyId).distinct().count();
but it isn't possible.