I\'m trying to make a @Query function in my @Dao interface which has a boolean parameter, isAsc to determine the order:
@Query
@Dao
isAsc
@Q
Why don't you try something like this? I have not tested it.
@Query("SELECT * FROM Persons ORDER BY first_name :order") List getPersonsAlphabetically(String order);
And the logic you suggested should go before you make the query.