I would like to have method like this in my dao object
@Query("SELECT c.name, sum(p.value) FROM payments p, paymentCategories c WHERE p.categoryId = c.id GROUP BY c.name")
fun getCategoryStats(): Map<String, Float>
but i get the error
error: Not sure how to convert a Cursor to this method's return type public abstract java.util.Map
Is it possible to change it to working version?
So it can be different type to return but the main conditions are
- It must be only one query in db
- I would like to avoid extra code like creating additional data structure only for this method