I am using the new Android ORM Room. And I faced the following issue, queries that use ORDER BY with arguments don't work.
If I want to use the field populated from a parameter for ORDER BY it does not work. It just doesn't sort anything.
@Query("SELECT * FROM User ORDER BY :orderBY ASC")
List<User> sortedFind(String orderBY);
But, when I put the ORDER BY column directly in the query to sort the results, then it works as expected.
@Query("SELECT * FROM User ORDER BY name ASC")
List<User> sortedFind();
Is it a bug on Android Room, or am I doing something wrong?