How can I get an array with only the column "Name" of my Category
model?
I can get all my categories using
List<Category> categoryList = new Select()
.from(Category.class)
.execute();
and then create another array with the name of the Category
, but I guess there is a way to get it directly and I cannot find how.
A little late in answering this, but the issue is because SQLiteUtils.rawQuery() makes the assumption that the Id column is always going to be in the cursor result. Set your columns String[] to {Id, your_column} and you'll be fine.
List<Category> categoryList = new Select(new String[]{"Id,your_column"}).from(Category.class).execute();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With