I need to get sum of the value field from Expense object and display this in textview, but I really don't know how to do it in Room Database. I need to create specific query in Dao or there is some other way?
Pojo:
@Entity(tableName = "expense_table")
public class Expense {
@PrimaryKey
private int id;
private String note;
private Double value;
private String type;
Dao:
@Dao
public interface ExpenseDao {
@Insert
void insertExpense(Expense expense);
@Query("SELECT * FROM expense_table")
LiveData<List<Expense>> getExpensesByDay();