I want to query the user associations list with the following room query using public constant variable Association.MEMBER_STATUS_APPROVED.
@Query("SELECT * FROM Association WHERE memberStatus = " + Association.MEMBER_STATUS_APPROVED)
LiveData<List<Association>> loadUserAssociations();
But, room gives me [SQLITE_ERROR] when build. It is possible to re-write that query by replacing the constant variable with parameter like the following.
@Query("SELECT * FROM Association WHERE memberStatus = :statusApproved")
LiveData<List<Association>> loadUserAssociations(String statusApproved);
I would like to know that does Room support such kind of string concatenation or String Format? (or) May be I missing something?