Marks a method in a Dao annotated class as a raw query method where you can pass the query as a SupportSQLiteQuery . … On the other hand, RawQuery serves as an escape hatch where you can build your own SQL query at runtime but still use Room to convert it into objects. RawQuery methods must return a non-void type.
What is the function of rawQuery () in android?
Like the query() method, rawQuery() returns a cursor containing the result set for the query. The caller can read and process the resulting cursor in the same way that it processes the result from the query() methods.
What is query method in android?
android.arch.persistence.room.Query. Marks a method in a Dao annotated class as a query method. The value of the annotation includes the query that will be run when this method is called. This query is verified at compile time by Room to ensure that it compiles fine against the database.